`fixMarkup` and `highlightBlock` methods with `{useBR: true}` break markup. I noticed, that `hljs.highlight(...)` generates the following code: `"<span class="hljs-symbol">[Created By]</span>"` Then `fixMarkup` for this string generates the following: `"[Created By]</span>"` Just comment `configure` method call and you'll see the difference (console output provided as well) https://jsfiddle.net/t1maqeb7/6/ I believe it should not break markup this way.