Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Incorrect syntax rendering, visible in std's toml.ts #1613

Closed
danopia opened this issue Dec 5, 2020 · 4 comments
Closed

Incorrect syntax rendering, visible in std's toml.ts #1613

danopia opened this issue Dec 5, 2020 · 4 comments

Comments

@danopia
Copy link

danopia commented Dec 5, 2020

Here: https://deno.land/std@0.79.0/encoding/toml.ts#L276
image

Seems like the mixing of quotes is causing the syntax highlighter to enter a very long multiline string that doesn't actually exist.

Reporting here as per Discord

@kt3k
Copy link
Member

kt3k commented Jan 1, 2021

This seems caused by the vendored version of Prism.js in react-prism-renderer repository
( https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/vendor/prism ), and even when we replaced the vendored prism with the latest prism.js, it still has the problem in handling template-literal at near line 644 of toml.ts. ( You can check it in prism.js playground.)

On the other hand, hightlight.js seems handling toml.ts without any error. (Created codesandbox demo for it.)

How about switching to highlight.js for syntax highlighting? cc @lucacasonato

@danopia
Copy link
Author

danopia commented Jan 3, 2021

The problem with latest prism.js is pretty wild, it depends on a couple different earlier lines in the file being present, including commented-out code. I've reported it here: PrismJS/prism#2694

I like prism overall, but it's hard for me to complain about switching if highlight.js works better & doesn't break on other things

@danopia
Copy link
Author

danopia commented Feb 5, 2021

The latest prismjs test page now renders this file correctly ^^ so should be cleared to upgrade the dependency

@crowlKats
Copy link
Member

Doesnt seem to be the case anymore after various prisma updates, so closing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants