Add support for type=application/json in HTML #5

Closed
rhagigi wants to merge 1 commit from application-json into main
rhagigi commented 2022-11-29 22:59:02 +01:00 (Migrated from github.com)

On Facebook, we use application/json script tags (open HTML source on facebook.com logged in), and would like to enable syntax highlighting and code folding . I opened a PR for devtools to add pretty printing, but was directed here for adding the highlighting/parsing by @bmeurer (see https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4047809 ).

This adds that support (hopefully)

On Facebook, we use application/json script tags (open HTML source on facebook.com logged in), and would like to enable syntax highlighting and code folding . I opened a PR for devtools to add pretty printing, but was directed here for adding the highlighting/parsing by @bmeurer (see https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4047809 ). This adds that support (hopefully)
marijnh commented 2022-11-30 07:58:02 +01:00 (Migrated from github.com)

Since this involves adding a dependency for a relatively rare use case, I don't want to make it part of the default configuration, and would recommend configuring it on an individual setup basis. The devtools already load the JSON parser, so adding it there would be unproblematic.

Since this involves adding a dependency for a relatively rare use case, I don't want to make it part of the default configuration, and would recommend [configuring](https://github.com/codemirror/lang-html/#user-content-html^config.nestedlanguages) it on an individual setup basis. The devtools already load the JSON parser, so adding it there would be unproblematic.
bmeurer commented 2022-11-30 09:01:54 +01:00 (Migrated from github.com)

Alright, that makes sense. We can put this into CodeHighlighter.ts on our end instead.

Alright, that makes sense. We can put this into `CodeHighlighter.ts` on our end instead.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/lang-html!5
No description provided.