highlightjs / highlight.js

JavaScript syntax highlighter with language auto-detection and zero dependencies.
https://highlightjs.org/
BSD 3-Clause "New" or "Revised" License
23.29k stars 3.52k forks source link

(YAML) Handling of '\' #4068

Open hoehrmann opened 4 days ago

hoehrmann commented 4 days ago

Highlight.js seems to treat '\' in YAML as escaping the ' but with ' quoting the backslash does not escape the apostrophe in YAML.

image

joshgoebel commented 3 days ago

Can anything be escaped in single quoted YAML strings?

hoehrmann commented 3 days ago

Can anything be escaped in single quoted YAML strings?

https://yaml.org/spec/1.2.2/#single-quoted-style covers this. The apostrophe can be escaped by doubling it. That's it.