Skip to content
Source
Sign inSign up
TanStack/highlight

Add isolated PHP highlighting with optional HTML support #18

Mergedtannerlinsleymerged 2 commits intomain fromtaren/php-languagemerged by tannerlinsley

tannerlinsleycommented

Adds a standalone PHP definition for documentation snippets and tagged PHP/HTML documents. It handles PHP tags, attributes, comments, variables, members, strings, heredocs, and nowdocs. Surrounding HTML is highlighted only when HTML is registered.

Adds language exports, fixtures, targeted regressions, a selective size profile, a PHP benchmark, documentation, and a minor changeset.

Validation: pnpm run verify passes, including 111 tests. All 334 existing documentation fixtures produce identical results. Four alternating benchmark rounds put existing highlighting at 102–104 ms before and 103–106 ms after, per 10,020 blocks.

With Node 24.15.0, PHP adds 990 gzip bytes to the all-language entry after C++/CMake, bringing it to 10,608 bytes. Core stays at 1,820 bytes, TSX at 4,033, and the docs set at 5,971. PHP alone with core is 3,564 gzip bytes. No shared engine changes or runtime dependencies.

Closes #9.

    1. Warning

      Review limit reached

      Next included review available in 49 minutes.

      Check out review usage here.

      View limit details

      Limit details: You’ve used the included review currently available.

      You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

      Learn how review limits work.

      Review configuration:

      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Advanced

      Run ID: ac27dfa0-c8c1-4bb1-910d-b13a13e0f26e

      📥 Commits

      Reviewing files that changed from the base of the PR and between 71594add2b49308ae6dfaf0016c634b974f72df9 and 7ff0aa1d024b9129fcd21f1bc2efe1b8000a41da.

      📒 Files selected for processing (19)
      • .changeset/php-language.md
      • README.md
      • docs/guides/embedded-languages.md
      • docs/guides/performance.md
      • docs/installation.md
      • docs/language-support.md
      • docs/reference/default-entry.md
      • docs/reference/languages.md
      • docs/test-strategy.md
      • scripts/bench.mjs
      • scripts/language-utils.mjs
      • scripts/measure-size.mjs
      • skills/configure-selective-highlighting/references/languages.md
      • src/index.ts
      • src/languages/index.ts
      • src/languages/php.ts
      • test/fixtures.ts
      • test/php.test.ts
      • test/real-doc-fixtures.test.ts

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. tannerlinsley merged thise33572b

    3. tannerlinsley closed this

Sign in to join this conversation.