Integrate Crayon highlighter with Markdown Editor in WordPress

Two things have to be changed:

  1. We have to move language specifier from <code class= to <pre lang=.
  2. The newline at the end of code block needs to be removed.

Here’s the diff:

In the meantime, I added a “text” language to Crayon highlighter and set it as the default language, so that Crayon won’t apply highlight the code block when no language is specified:

Leave a Reply

Your email address will not be published.