最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Reveal.js HTML Code syntax highlighting without rendering it - Stack Overflow

programmeradmin4浏览0评论

Question for reveal.js users.

I am trying to show a HTML markup in my reveal.js presentation. Issue is it renders the html block within my Code syntax highlighting block so the markup can not be seen.

Is there a way around this?

example below

<section>
    <h2>Pretty Code</h2>
        <pre>
            <code contenteditable>

                <form id="demo-form" data-validate="parsley">
                <label for="fullname">Full Name * :</label>
                <input type="text" id="fullname" name="fullname" data-required="true" />

                <label for="email">Email * :</label>
                <input type="text" id="email" name="email" data-trigger="change" data-required="true" data-type="email" />

                <label for="website">Website :</label>
                <input type="text" id="website" name="website" data-trigger="change" data-type="url" />

                <label for="message">Message (20 chars min, 200 max) :</label>
                <textarea id="message" name="message" data-trigger="keyup" data-rangelength="[20,200]"></textarea>
                </form> 

            </code>
        </pre>
</section>

Question for reveal.js users.

I am trying to show a HTML markup in my reveal.js presentation. Issue is it renders the html block within my Code syntax highlighting block so the markup can not be seen.

Is there a way around this?

example below

<section>
    <h2>Pretty Code</h2>
        <pre>
            <code contenteditable>

                <form id="demo-form" data-validate="parsley">
                <label for="fullname">Full Name * :</label>
                <input type="text" id="fullname" name="fullname" data-required="true" />

                <label for="email">Email * :</label>
                <input type="text" id="email" name="email" data-trigger="change" data-required="true" data-type="email" />

                <label for="website">Website :</label>
                <input type="text" id="website" name="website" data-trigger="change" data-type="url" />

                <label for="message">Message (20 chars min, 200 max) :</label>
                <textarea id="message" name="message" data-trigger="keyup" data-rangelength="[20,200]"></textarea>
                </form> 

            </code>
        </pre>
</section>
Share Improve this question edited Mar 7, 2019 at 16:09 Cœur 38.7k26 gold badges203 silver badges277 bronze badges asked Jan 24, 2013 at 14:27 BaconJuiceBaconJuice 3,77915 gold badges59 silver badges90 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 17

Escape the html tags, and then all should look ok. Here is a tool that convert raw HTML to escaped strings: http://www.accessify./tools-and-wizards/developer-tools/quick-escape/default.php

So you have to copy the code section enclosed between the <code> html markup.

发布评论

评论列表(0)

  1. 暂无评论