Skip to content

Fix multiline Python syntax highlighting across code rows - #685

Draft
hackjutsu wants to merge 2 commits into
masterfrom
codex/fix-333-multiline-highlighting
Draft

hackjutsu wants to merge 2 commits into
masterfrom
codex/fix-333-multiline-highlighting

Conversation

@hackjutsu

Copy link
Copy Markdown
Owner

Fixes #333.

Python triple-quoted strings lose highlighting after the first line because the code viewer splits Highlight.js HTML into table rows. Preserve all active spans across row boundaries, including nested scopes, and replace the C-comment-only workaround.

Adds regression coverage for both triple-quote styles, multiline comments, nested spans, escaped text, CRLF, blank lines, and trailing newlines. A Python Electron fixture checks continuation-line colors, closing delimiters, visible rows, and line numbers.

Validation:

  • npm run lint — passed.
  • npm test — 419 tests across 62 files passed; webpack development build passed. Repeated on current master in an isolated worktree.
  • npm run build — passed.
  • Targeted python-multiline Electron smoke — passed.
  • Launched locally with LEPTON_RENDER_FIXTURE=python-multiline npm start using isolated config/user data. Confirmed visible Lepton UI, consistent string highlighting across lines, and intact blank lines/line numbers. Inspected DOM/computed colors and captured the running renderer.

Screenshot from the local fixture launch:

Python multiline strings retain highlighting across rows

This branch has not been deployed

No deployments
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.

Python 代码高亮问题

1 participant