196 lines
6.2 KiB
HTML
196 lines
6.2 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
|
|||
|
<meta charset="utf-8" />
|
|||
|
<link rel="icon" href="favicon.png" />
|
|||
|
<title>Unescaped markup ▲ Prism plugins</title>
|
|||
|
<base href="../.." />
|
|||
|
<link rel="stylesheet" href="style.css" />
|
|||
|
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
|
|||
|
<link rel="stylesheet" href="plugins/unescaped-markup/prism-unescaped-markup.css" data-noprefix />
|
|||
|
|
|||
|
<script src="prefixfree.min.js"></script>
|
|||
|
|
|||
|
<script>var _gaq = [['_setAccount', 'UA-33746269-1'], ['_trackPageview']];</script>
|
|||
|
<script src="https://www.google-analytics.com/ga.js" async></script>
|
|||
|
</head>
|
|||
|
<body class="language-markup">
|
|||
|
|
|||
|
<header>
|
|||
|
<div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
|
|||
|
|
|||
|
<h2>Unescaped markup</h2>
|
|||
|
<p>Write markup without having to escape anything.</p>
|
|||
|
</header>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>How to use</h1>
|
|||
|
<p>This plugin provides several methods of achieving the same thing:</p>
|
|||
|
|
|||
|
<ul>
|
|||
|
<li>Instead of using <code><pre><code></code> elements, use <code><script type="text/plain"></code>
|
|||
|
<pre><code><script type="text/plain" class="language-markup">
|
|||
|
<p>Example</p>
|
|||
|
</script></code></pre>
|
|||
|
</li>
|
|||
|
<li>Use a HTML-comment to escape your code
|
|||
|
<pre><code><pre class="language-markup"><code><!--
|
|||
|
<p>Example</p>
|
|||
|
--></code></pre></code></pre></li>
|
|||
|
</ul>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>Examples</h1>
|
|||
|
|
|||
|
<p>View source to see that the following didn’t need escaping (except for <code></script></code>, that does):</p>
|
|||
|
|
|||
|
<script type="text/plain"><!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
|
|||
|
<meta charset="utf-8" />
|
|||
|
<link rel="icon" href="favicon.png" />
|
|||
|
<title>Keep markup ▲ Prism plugins</title>
|
|||
|
<base href="../.." />
|
|||
|
<link rel="stylesheet" href="style.css" />
|
|||
|
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
|
|||
|
|
|||
|
<script src="prefixfree.min.js"></script>
|
|||
|
</head>
|
|||
|
<body class="language-markup">
|
|||
|
|
|||
|
<header>
|
|||
|
<div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
|
|||
|
|
|||
|
<h2>Unescaped markup</h2>
|
|||
|
<p>Write markup without having to escape anything.</p>
|
|||
|
</header>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>How to use</h1>
|
|||
|
<p>Instead of using <code><pre><code></code> elements, use <code><script type="text/plain"></code>:</p>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>Examples</h1>
|
|||
|
|
|||
|
<p>With <code><script type="text/plain"></code>:</p>
|
|||
|
|
|||
|
<script type="text/plain"><div><span>Foo</span></div></script>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>FAQ</h1>
|
|||
|
|
|||
|
<p>Why not use the HTML <code><template></code> tag?</p>
|
|||
|
|
|||
|
<p>Because it is a PITA to get its <code>textContent</code> and needs to be pointlessly cloned.
|
|||
|
Feel free to implement it yourself and send a pull request though, if you are so inclined.</p>
|
|||
|
|
|||
|
<p>Can I use this inline?</p>
|
|||
|
|
|||
|
<p>Not out of the box, because I figured it’s more of a hassle to type <code><script type="text/plain"></code> than escape the 1-2 <code><</code> characters you need to escape in inline code.
|
|||
|
Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.</p>
|
|||
|
</section>
|
|||
|
|
|||
|
<footer data-src="templates/footer.html" data-type="text/html"></footer>
|
|||
|
|
|||
|
<script src="prism.js"></script>
|
|||
|
<script src="plugins/unescaped-markup/prism-unescaped-markup.js"></script>
|
|||
|
<script src="utopia.js"></script>
|
|||
|
<script src="components.js"></script>
|
|||
|
<script src="code.js"></script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html></script>
|
|||
|
|
|||
|
<p>The next example uses the HTML-comment method:</p>
|
|||
|
|
|||
|
<pre><code><!--<!DOCTYPE html>
|
|||
|
<html lang="en">
|
|||
|
<head>
|
|||
|
|
|||
|
<meta charset="utf-8" />
|
|||
|
<link rel="icon" href="favicon.png" />
|
|||
|
<title>Keep markup ▲ Prism plugins</title>
|
|||
|
<base href="../.." />
|
|||
|
<link rel="stylesheet" href="style.css" />
|
|||
|
<link rel="stylesheet" href="themes/prism.css" data-noprefix />
|
|||
|
|
|||
|
<script src="prefixfree.min.js"></script>
|
|||
|
</head>
|
|||
|
<body class="language-markup">
|
|||
|
|
|||
|
<header>
|
|||
|
<div class="intro" data-src="templates/header-plugins.html" data-type="text/html"></div>
|
|||
|
|
|||
|
<h2>Unescaped markup</h2>
|
|||
|
<p>Write markup without having to escape anything.</p>
|
|||
|
</header>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>How to use</h1>
|
|||
|
<p>Instead of using <code><pre><code></code> elements, use <code><script type="text/plain"></code>:</p>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>Examples</h1>
|
|||
|
|
|||
|
<p>With <code><script type="text/plain"></code>:</p>
|
|||
|
|
|||
|
<script type="text/plain"><div><span>Foo</span></div></script>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>FAQ</h1>
|
|||
|
|
|||
|
<p>Why not use the HTML <code><template></code> tag?</p>
|
|||
|
|
|||
|
<p>Because it is a PITA to get its <code>textContent</code> and needs to be pointlessly cloned.
|
|||
|
Feel free to implement it yourself and send a pull request though, if you are so inclined.</p>
|
|||
|
|
|||
|
<p>Can I use this inline?</p>
|
|||
|
|
|||
|
<p>Not out of the box, because I figured it’s more of a hassle to type <code><script type="text/plain"></code> than escape the 1-2 <code><</code> characters you need to escape in inline code.
|
|||
|
Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.</p>
|
|||
|
</section>
|
|||
|
|
|||
|
<footer data-src="templates/footer.html" data-type="text/html"></footer>
|
|||
|
|
|||
|
<script src="prism.js"></script>
|
|||
|
<script src="plugins/unescaped-markup/prism-unescaped-markup.js"></script>
|
|||
|
<script src="utopia.js"></script>
|
|||
|
<script src="components.js"></script>
|
|||
|
<script src="code.js"></script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>--></code></pre>
|
|||
|
</section>
|
|||
|
|
|||
|
<section>
|
|||
|
<h1>FAQ</h1>
|
|||
|
|
|||
|
<p>Why not use the HTML <code><template></code> tag?</p>
|
|||
|
|
|||
|
<p>Because it is a PITA to get its <code>textContent</code> and needs to be pointlessly cloned.
|
|||
|
Feel free to implement it yourself and send a pull request though, if you are so inclined.</p>
|
|||
|
|
|||
|
<p>Can I use this inline?</p>
|
|||
|
|
|||
|
<p>Not out of the box, because I figured it’s more of a hassle to type <code><script type="text/plain"></code> than escape the 1-2 <code><</code> characters you need to escape in inline code.
|
|||
|
Also inline code is not as frequently copy-pasted, which was the major source of annoyance that got me to write this plugin.</p>
|
|||
|
</section>
|
|||
|
|
|||
|
<footer data-src="templates/footer.html" data-type="text/html"></footer>
|
|||
|
|
|||
|
<script src="prism.js"></script>
|
|||
|
<script src="plugins/unescaped-markup/prism-unescaped-markup.js"></script>
|
|||
|
<script src="utopia.js"></script>
|
|||
|
<script src="components.js"></script>
|
|||
|
<script src="code.js"></script>
|
|||
|
|
|||
|
</body>
|
|||
|
</html>
|