highlight.js
highlight.js copied to clipboard
(YAML) Multiline strings don't support empty lines
Describe the issue YAML multiline strings break on first empty line even when the rest of the block is properly indented.
Which language seems to have the issue? YAML
Are you using highlight
or highlightAuto
?
highlight
Sample Code to Reproduce
foo:
bar: |
still: a string
not: anymore
Additional context I was able to workaround the issue by replacing this regex with
[\\|>]([1-9]?[+-])?[ ]*\\n+( +)[^ ][^\\n]*\\n+(\\2[^\\n]+\\n*)*
It's not perfect and still has some false positives/negatives but should cover more valid cases.