Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 721
u01jmg3 Avatar asked Oct 30 '16 10:10

u01jmg3


1 Answers

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.

like image 64
riezebosch Avatar answered Oct 09 '22 23:10

riezebosch