elm-book
elm-book copied to clipboard
Syntax highlighting
Currently when rendering code blocks there is no out-of-the-box syntax highlighting but also no easy way to add a custom implementation since the <code />
element doesn't get information from the markdown language name tag. In the images attached as an example, the markdown code block has the javascript tag but the generated <code />
element only gets a class name of elmsh
and the generated code is simply unstyled white on black.
Markdown:
Generated HTML:
Unstyled content:
It would be nice to get either out-of-the-box syntax highlighting OR some form of data-*
attribute to implement some custom logic if otherwise preferred.
the data approach seems doable! the other strategy is a bit more problematic since elm-book is hosted on elm-packages so there is no way for us to include custom js scripts that would handle all of the possible syntaxes. Thanks for opening this PR, I'll try to get this merged on an upcoming release.