reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Bug: Bad fragment numbering when using `div` and `code`

Open gabyx opened this issue 1 year ago • 2 comments

I am thinking the following is a bug in Reveal.js. The codeblock line-numbering should show up as third element

<section class="slide">
  <div class="columns">

    <div class="fragment" data-fragment-index="1">
      <p>second</p>
      <pre class="go">
        <code data-line-numbers="1|2" data-fragment-index="2">                  third
          forth
        </code>
      </pre>
    </div>

    <div class="fragment" data-fragment-index="0">
      <p>first</p>
    </div>
  </div>
</section>

Inserting this into the demo.html presentation does not work:

The code focus should appear after second, which it does not. It appears with fragment 1. Reveal Version 5.1.0

gabyx avatar Aug 12 '24 11:08 gabyx

Something with the recomputing of values for data-fragment-index is off. The data-fragment-index="2" gets always reset to 0 which is weird...

gabyx avatar Aug 12 '24 11:08 gabyx

The fragment.js sort function seems not to respect code blocks.

gabyx avatar Aug 12 '24 12:08 gabyx