Reveal.js HTML Code syntax highlighting without rendering it

≯℡__Kan透↙ 提交于 2019-12-07 00:07:39

问题


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>

回答1:


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

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



来源:https://stackoverflow.com/questions/14503631/reveal-js-html-code-syntax-highlighting-without-rendering-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!