darshandsoni / asciidoctor-skins

Control how your asciidoctor powered documentation looks

Home Page:https://darshandsoni.com/asciidoctor-skins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using the switcher.js makes syntax highlightning from highlight.js disappear.

janderssonse opened this issue · comments

When using the switcher.js as described (for example, here as a passthrough in the asciidoc)

//skin selector for HTML backend
++++

<script src="https://darshandsoni.com/asciidoctor-skins/switcher.js" type="text/javascript"></script>

++++

highlighter.js does not work anymore after a skin has been changed, only the first time. As Highlight.js is one of the supported syntax colourings for asciidoctor, it would be great if the switcher and highlight.js could work together seamslessly.

By having a quick look I think that all that needs do be done in switcher.js would be to make a check if there exits a hljs object and if so just call hljs.initHighlightning() again