jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
189 stars 61 forks source link

Prevent invalid CSS generation #94

Closed typeofweb closed 4 years ago

typeofweb commented 4 years ago

code span. { is invalid CSS. It works in all browsers, however, it yields a warning when used in epub-validator.

Therefore I suggest this fix. I never wrote any Haskell before thus sorry for my non-idiomatic style. I'll gladly update the PR with any suggestions the maintainers make. Thank you :)

jgm commented 4 years ago

thanks!

typeofweb commented 4 years ago

@jgm do you think it could be released and also bumped in pandoc?

jgm commented 4 years ago

I can prepare a new skylighting release. pandoc's constraints should be compatible.

But can you explain first how you got the invalid span. output? I'm not seeing it in default pandoc output. You must be doing something special?

jgm commented 4 years ago

Ah, I see, you get it for some styles but not others, because some styles don't define anything for NormalTok.

typeofweb commented 4 years ago

I'm using kate style with typescript so maybe that's why :) Thanks so much!