-
Notifications
You must be signed in to change notification settings - Fork 21
Description
I am having some problems with this library and pre tags.
See this usage from my project:
const highlightedHTML = highlight(codeString).replace(/\n/g, "");
I added that replace
because it was showing some extra empty horizontal lines inside pre tags, like this:

If I keep that replace
used above, it actually fixes the problem in development mode and the extra space between the lines as shown above is gone but now in production, it shows:

Can you please have a look? Are those extra lines default behavior? and how to remove them such that it works ok both in dev and prod?
It seems the reason why replace
fixed the problem in development mode was related to this element:
<span class="sh__token--string" style="color: var(--sh-string)">
</span>
This span was usually present as a child (one before the last) under each sh__line
span. And this element causes empty horizontal line too. So when there was this element but no replace
there were two empty horizontal lines. And using replace
as mentioned above, reduced those empty lines to one. That's why it worked in development.
Strangely, in production, this element is not rendered. And using replace
removes the one remaining empty line too. Which explains why in production mode everything was on single line like in the second screenshot.
UPDATE: this span element is present on Windows, not on Ubuntu (in developmemt mode).