jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
194 stars 62 forks source link

[HTML] Highlighted inline code within strikeout is not applied correctly #79

Closed mpark closed 5 years ago

mpark commented 5 years ago

Consider: ~~foo `constexpr`{.cpp} bar~~ With pandoc foo.md --output foo.html --self-contained this currently generates:

Screen Shot 2019-06-13 at 10 46 58 PM

The desired output would be something like:

Screen Shot 2019-06-13 at 10 47 19 PM

This seems to be caused by the display: inline-block from https://github.com/jgm/skylighting/blob/8c650b6e4aafc4c5eafb82d6e3449f3a67e066ee/skylighting-core/src/Skylighting/Format/HTML.hs#L170. Changing this to display: inline produces the desired output.

jgm commented 5 years ago

@dbaynard may be able to say more than I can about why display: block is in there...

dbaynard commented 5 years ago

This is a bug, introduced in 0b07bbc8 when the line span tags were simplified — I didn't notice the clash.

<code class="sourceCode cpp"><span class="kw">constexpr</span></code>

This is treating the span as a line. The css should probably restrict that behaviour to pre > code.sourceCode > span. I'm making the PR, now