Skip to content

Stdlib: highlight_file() multiline <br /> line breaks (#17557) - #17560

Merged
PurHur merged 2 commits into
masterfrom
agent/issue-17557-highlight-file-br
Jul 10, 2026
Merged

PurHur merged 2 commits into
masterfrom
agent/issue-17557-highlight-file-br

Conversation

@PurHur

@PurHur PurHur commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Convert newlines to <br /> inside highlight spans in HighlightEngine::escapeAndFormat() to match Zend ext/standard/highlight.c
  • Color T_INLINE_HTML as default black (#000000) instead of keyword green — plain-text file lines match Zend

php-src reference

  • ext/standard/highlight.c / php_highlight.h — HTML assembly with <br /> line separators

PHP implementation

  • ext/standard/HighlightEngine.php

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_highlight_file_br.php'
# br_count=2
# content_newline=false
# ok

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter highlight'
# OK (28 tests, 37 assertions)

Closes #17557

Made with Cursor

PurHur and others added 2 commits July 10, 2026 06:37
…17557)

Match Zend ext/standard/highlight.c — convert newlines to <br /> inside
highlight spans and color T_INLINE_HTML as default black.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit fabf11c into master Jul 10, 2026
@PurHur
PurHur deleted the agent/issue-17557-highlight-file-br branch July 10, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdlib: highlight_file() emits raw newlines not <br /> between lines (ext/standard/highlight.c)

1 participant