Open rahmanusta opened 1 year ago
Hey!
It might be possible to conditionally call SyntaxHighlighter.register
instead of using:
However, I'm not really sure how/when we should call it since the SyntaxHighlighter
registry is a singleton so I don't think you can have more than one instance.
We could potentially use the backend
argument in the constructor to delegate or not to the built-in Highlight.js syntax highlighter when the backend is html5 or revealjs:
In other words, the highlight.js adapter (from this converter) will still override the built-in highlight.js syntax highlighter in the registry but use the built-in when the backend is not revealjs
. What do you think?
Hello,
In AsciidocFX, I use AsciidoctorJ to construct a certain number of Asciidoctor instances and load all required libraries all at once. I recently discovered that the highlight js numbering extension registers itself even though that the backend is HTML5. I assumed the asciidoctor-* libraries were isolated from each other if they targeted a specific backend. I think the library should not interfere with the other backends. May it be possible to activate Reveal's highlight.js extension only if the backend is reveal.js ?
https://github.com/asciidoctor/asciidoctor-reveal.js/blob/93b307304f8e132e3f13403c94a9ea010891b859/lib/asciidoctor-revealjs/highlightjs.rb#L6