Skip to content

highlight.js: support for JSONL, JSON-Seq, basic multipart, improve text/event-stream #4553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

handrews
Copy link
Member

@handrews handrews commented Apr 27, 2025

Improve text/event-stream highlight.js support with comment support and generally better configuration (one rule wasn't doing anything).

Add support for JSONL/NDJSON (basically JSON without the check for values separated only by whitespace) and JSON Text Sequences (which requires using 0x1E as the record separator, and highlighting it separately).

Multipart support is very basic, and only supports Content- part headers (which is what you generally use anyway).

Examples from the updated test fixtures:

Screen Shot 2025-04-28 at 8 56 37 PM

Improve text/event-stream support with comment support and
generally better configuration (one rule wasn't doing anything).

Add support for JSONL/NDJSON (basically JSON without the check
for values separated only by whitespace) and JSON Text Sequences
(which requires using `0x1E` as the record separator, and
highlighting it separately).
@handrews handrews added the script Pull requests that update Bash or JavaScript code label Apr 27, 2025
@handrews handrews requested review from a team as code owners April 27, 2025 22:07
@handrews handrews changed the title Add support for JSON Lines and JSON Text Sequences, improve text/event-stream Add highlight.js support for JSON Lines and JSON Text Sequences, improve text/event-stream Apr 28, 2025
@handrews handrews changed the title Add highlight.js support for JSON Lines and JSON Text Sequences, improve text/event-stream highlight.js: support for JSON Lines and JSON Text Sequences, improve text/event-stream Apr 28, 2025
@handrews handrews changed the title highlight.js: support for JSON Lines and JSON Text Sequences, improve text/event-stream highlight.js: support for JSON Lines and JSON Text Sequences, improve text/event-stream Apr 28, 2025
@handrews handrews changed the title highlight.js: support for JSON Lines and JSON Text Sequences, improve text/event-stream highlight.js: support for JSONL, JSON-Seq, basic multipart, improve text/event-stream Apr 29, 2025
@handrews
Copy link
Member Author

Last commit added some very basic multipart support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
script Pull requests that update Bash or JavaScript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant