You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a solution. I added the following in the end of the sampler plugin code:
if (typeof hljs !== 'undefined') {
hljs.highlightBlock(element);
}
// this is new:
if (typeof RevealHighlight !== 'undefined') {
RevealHighlight().highlightBlock(element);
}
I just upgraded my slides from reveal.js 3.x to 4.1
In the slides, code is included from code files using the sampler plugin. https://github.com/ldionne/reveal-sampler
<pre><code class="java" data-sample='path/to/source.java'></code></pre>
The problem is that the code on the slide is not highlighted anymore. I guess this is because the highlight plugin needs to be loaded asynchronously?
Does anybody have a solution for how to support code highlighting for code that is not hard-coded within the slides?
The text was updated successfully, but these errors were encountered: