Reveal.js: Element Attributes only support simple markdown, no nested inline elements

Created on 16 Aug 2016  Â·  8Comments  Â·  Source: hakimel/reveal.js

Consider:

<section data-markdown>
    <script type="text/template">
        #intro to svg
        - Vector images <!-- .element: class="fragment" -->
        - A permutation of `XML` <!-- .element: class="fragment" -->
    </script>
</section>

This results in A permutation of XML just showing up onSlideLoad, ignoring the intended fragment order.

I tried <!-- li: class="fragment" --> but that just displays all list items onSlideLoad.

This applies for anything in markdown that would create html inside of that line (italic, bold, pre, etc).

I'd like for a way to denote fragments in markdown for elements that contain inline elements.

Most helpful comment

Seen this quite a few times, see also #1242 and #1001.

The following works around it:

# Slide Title
- <!-- .element: class="fragment" --> Something with `code`

All 8 comments

Seen this quite a few times, see also #1242 and #1001.

The following works around it:

# Slide Title
- <!-- .element: class="fragment" --> Something with `code`

I've the same issue with bold and markdown:

<section data-markdown>
    <script type="text/template">
      ### Alignak: the monitoring framework (2/2)
      Alignak is made of several parts that can be run on the same server or distributed:

      *  **Arbiter:** manages configuration and is an orchestra conductor <!-- .element: class="fragment" data-fragment-index="1" -->
    </script>
</section>

Put "comment" before solve it.

Yes can confirm, I was having the same problem and was sad because I really like the markdown syntax.

The solution proposed by @STRML works nicely. Maybe you should present this version of the solution here? This way people would not stumble on this 'nested' problem?

Sorry I keep meaning to followup—@STRML's workaround is indeed what I was looking for, and I agree with @nschoe that this use case is common enough that if the workaround is intended to be the 'correct' approach, it should be included in the readme

Perhaps even better, it would be good to have a new syntax for this. I've used https://github.com/rstacruz/markdown-it-decorate in personal projects and I find the extra flexibility to be really useful.

The workaround doesn't really work anymore. It seems to disable Markdown for that item, so it gets rendered as "something with `code`" rather than "something with code".

what time are we supposed cc

- foo <!-- .element: class="fragment" -->
- bar <!-- .element: class="fragment" -->
<li class="fragment"><a href="example.com">baz</a></li>

works, as a bit of an ugly workaround.

Was this page helpful?
0 / 5 - 0 ratings