简体   繁体   中英

Reveal.js markdown fragment

I creating a presentation with Reveal.js and I'm using markdown to write it.

Consider a section like

<section data-markdown>
    <script type="text/template">
        ## Title

        > A little quote with some `code`
    </script>
</section>

I would like the > Quote to become a fragment and appear at mouse clink. If I simply use <!-- .element: class="fragment" --> as it is stated in the reveal.js documentation, only the code part becomes a fragment.

How can I make all of the > A little quote with some code paragraph become a fragment?

I'm using a VSCode-reveal (an extension for VSCode) that lets me do markdown files and generates the Reveal wrapping. There is a shortcut syntax for fragments {.fragment} .

It's quirky when markdown formatting is applied, as it tends to "stick" to the closest element. For example, I can get the problem you describe if I do this:

## Title

> A little quote with some `code`{.fragment}

But if I leave a space after the 'code' part, it gives the desired behavior, probably because it applies to the quote's element, rather than the code formatted element:

## Title

> A little quote with some `code` {.fragment}

However, using <!-- .element: class="fragment" --> I could not reproduce your problem. I suspect this is a difference in reveal versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM