Skip to content

Commit a348526

Browse files
committed
Fix issue with code examples not working after any demos
This works around an issue where a demo embedded within the page would cause any code samples in the rest of the page to not be highlighted correctly. Prism would try to format the demo HTML as CLI code and throw an error in the process.
1 parent 47518f3 commit a348526

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

demo_tpl.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Note that the space in the <code> </code> blocks is significant:
2+
// without it, any demo in a page would break the rest of the code
3+
// examples throughout the page.
4+
15
module.exports = `
26
<ul>
37
<li class="tab" data-tab="demo">Demo</li>
@@ -8,9 +12,9 @@ module.exports = `
812
<iframe></iframe>
913
</div>
1014
<div class="tab-content" data-for="html">
11-
<pre class="line-numbers language-html"><code></code></pre>
15+
<pre class="line-numbers language-html"><code> </code></pre>
1216
</div>
1317
<div class="tab-content" data-for="js">
14-
<pre class="line-numbers language-js"><code></code></pre>
18+
<pre class="line-numbers language-js"><code> </code></pre>
1519
</div>
1620
`;

0 commit comments

Comments
 (0)