How to apply `data-trim` and `data-noescape` to a markdown code block in Reveal.js?
Asked Answered
P

1

7

Is there any way to use the following two attributes in a markdown code block (rather than using HTML)?

<code data-trim data-noescape>...</code>

I tried adding these programmatically once the page has loaded but they don't get used (makes sense). I have also looked to see whether I can always have these settings by passing them as an option to marked.js / markdown.js but the plugins don't appear to allow this.

This relates to using Reveal.js - see documentation.

Postmortem answered 30/10, 2016 at 10:24 Comment(0)
C
1

My current work around is using inline html instead:

<pre><code class="bash" data-noescape data-trim>
    ...
</code></pre>

The element attributes hack unfortunately doesn't seem to add empty attributes.

Cleavers answered 17/7, 2017 at 19:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.