Syntax Highlighting In Wyam

Sunday, January 5, 2020 - Posted in

In my previous blog post I saw that the syntax highlighting was weird on a phone.
A carriage return was added automatically instead of taking advantage of the power of a scrollbar.

Syntax with carriage return

To avoid the carriage return and let the scrollbar work as expected we need to override the CSS with the following style:
pre code {
        white-space: pre;
        word-wrap: normal;
}

Just create the following folder structure in your input directory, create a file named override.css and add the pre code style in it.

Folder structure

Build your blog and start the preview to see the result.

Folder structure

comments powered by Disqus