decker-edu / decker

A markdown based tool for slide deck creation.
GNU General Public License v3.0
55 stars 13 forks source link

kv-pairs of code blocks get wrong "data-data" prefix #4

Closed mbotsch closed 1 year ago

mbotsch commented 1 year ago

Key-value-pairs (e.g. decker=cool) get wrong prefix (data-data-decker=cool)

``` {.cpp decker=cool}
some code
gets translated to

some code

```
It should prefix just one "data-".

Since this also happens with `line-numbers=2-5`, it breaks highlighting of code lines.             
monofon commented 1 year ago

Please post the entire deck. Also, which resource pack?

I am seeing this:

``` {.cpp decker="cool"}
some.code();

```html
<div class="media">
  <figure class="code">
    <div class="sourceCode" id="cb1" data-decker="cool">
      <pre
        class="sourceCode cpp"
      ><code class="sourceCode cpp"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>some<span class="op">.</span>code<span class="op">();</span></span></code></pre>
    </div>
  </figure>
</div>
mbotsch commented 1 year ago

The error only shows up when the code block has a caption:

``` {.cpp decker="cool"}
some.code();

Caption: Only fails with caption.

leads to
               some.code();
            
Only fails with caption.

It seems that some filter is running twice, since also the HTML structure is doubled.
monofon commented 1 year ago

Or with highlightjs: true:

<figure class="code">
  <pre class="cpp" data-decker="cool">
    <code>some.code();</code>
  </pre>
</figure>
mbotsch commented 1 year ago

Works now, thanks