Closed
Description
Describe the issue/behavior that seems buggy
Preformatted code is lost after highlighting a block in 11.1.
It seems that in version 10 br
elements were inserted, and now they aren't. Although I don't know why that should matter in a pre
block.
Sample Code or Instructions to Reproduce
I have a little library that uses highlight to embed source using web components.
https://kag0.github.io/sauce/
You can see on the documentation page, it's embedding snippets from an example html file in the repo https://kag0.github.io/sauce/example.html but they're missing the line breaks.
To prove that they would normally have line breaks:
- clone the repo
- open
example.html
and change the script embed fromhttps://kag0.github.io/sauce/sauce.js
to the localsauce.js
- open
sauce.js
and comment out line 43.then(_ => hljs.highlightBlock(code))
- open
example.html
in the browser, observe that line breaks and indentation are correct - uncomment the line and observe that code is highlighted, but line breaks are gone
Expected behavior
line breaks should be preserved