noscript output seems to break sometimes when using Commonmark
Closed this issue · 1 comments
This plugin seems to break it's output when attempting to embed the following gist when noscript is enabled, and jekyll-commonmark is used as the markdown renderer
- https://gist.github.com/0xdevalias/e8bb28726a37854606ad
- embedded into a blog post with
{% gist 0xdevalias/e8bb28726a37854606ad %}
_config.yml
markdown: CommonMark
commonmark:
options: ["UNSAFE", "FOOTNOTES", "STRIKETHROUGH_DOUBLE_TILDE", "VALIDATE_UTF8", "GITHUB_PRE_LANG", "HARDBREAKS"]
extensions: ["autolink", "strikethrough", "table", "tasklist"]
Rendered snippet
<p><noscript><pre># Dogedraw, now with more Nyaan!</p>
<p>Paste these functions into the js console on <a href="https://dogedraw.firebaseapp.com">https://dogedraw.firebaseapp.com</a> and run them to nyaan nyaan nyaan..</p>
<p>Developed at <a href="http://hs.hact.io">http://hs.hact.io</a> 2015!!</p>
<pre><code>function clearScreen(w, h, color) {
var pixelDataRef = new Firebase(&#39;https://dogedraw.firebaseio.com/pixels&#39;);
for (var i = 0; i &lt; h; i++) {
for (var j = 0; j &lt; w; j++) {
pixelDataRef.child(j + &quot;:&quot; + i).set(color);
}
}
}
function nyaan(startX, startY) {
function rpt(value, times) {
var arr = [];
for (rpti = 0; rpti &lt; times; rpti++) {
arr[rpti] = value;
}
return arr;
}
function cc(arr) {
var joined = [];
for (cci = 0; cci &lt; arr.length; cci++) {
joined = joined.concat(arr[cci]);
}
return joined;
}
var nyaanHax = new Firebase(&#39;https://dogedraw.firebaseio.com/pixels&#39;);
var w = &quot;fff&quot; // white
var bl = &quot;00f&quot; // blue
var k = &quot;000&quot; // black
var r = &quot;f00&quot; // red
var gy = &quot;333&quot; // grey
var gr = &quot;0f0&quot; // green
var y1 = &quot;FFFFE0&quot; // pale yellow
var y2 = &quot;FFFF00&quot; // yellow
var o = &quot;FF4500&quot; // orange
var p1 = &quot;FFC0CB&quot; // pink
var p2 = &quot;9370DB&quot; //purple
var p3 = &quot;800080&quot; // dark purple
var nyaan = []
nyaan[0] = rpt(w, 38)
nyaan[1] = cc([rpt(w, 3), rpt(r, 6), rpt(w, 7), rpt(k, 14), rpt(w, 8)])
nyaan[2] = cc([[w], rpt(r, 14), [k], rpt(y1, 14), [k], rpt(w, 7)])
nyaan[3] = cc([[w], rpt(r, 3), rpt(o, 5), rpt(r, 5), [k, y1, y1], rpt(p1, 4), [p2, p1, p1, p2], rpt(p1, 3), rpt(y1, 3), [k], rpt(w, 6)])
nyaan[4] = cc([[w], rpt(o, 13), [k, y1], rpt(p1, 2), [p2], rpt(p1, 4), [k, k], rpt(p1, 5), [y1, k, w, k, k], rpt(w, 3)])
nyaan[5] = cc([[w], rpt(o, 3), rpt(y2, 4), rpt(k, 4), rpt(o, 2), [k, y1], rpt(p1, 6), [k, gy, gy, k], [p1, p1, p2, p1, y1, k, k, gy, gy, k], rpt(w, 2)])
nyaan[6] = cc([[w], rpt(y2, 6), [k, gy, gy, gy], rpt(k, 4), [y1], rpt(p1, 6), [k, gy, gy, gy, k], rpt(p1, 3), [y1, k, gy, gy, gy, k], rpt(w, 2)])
nyaan[7] = cc([[w], rpt(y2, 3), rpt(gr, 3), [k, k], rpt(gy, 5), [k, y1], rpt(p1, 3), [p2], rpt(p1, 2), [k], rpt(gy, 4), rpt(k, 4), rpt(gy, 4), [k], rpt(w, 2)])
nyaan[8] = cc([[w], rpt(gr, 8), rpt(k, 4), [gy, k, y1], rpt(p1, 6), [k], rpt(gy, 12), [k], rpt(w, 2)])
nyaan[9] = cc([[w], rpt(gr, 3), rpt(bl, 8), rpt(k, 3), [y1], rpt(p1, 4), [p2, k], rpt(gy, 3), [w, k], rpt(gy, 5), [w, k, gy, gy, k, w]])
nyaan[10] = cc([[w], rpt(bl, 13), [k, y1, p1, p2], rpt(p1, 3), [k], rpt(gy, 3), [k, k], rpt(gy, 3), [k, gy, k, k, gy, gy, k, w]])
nyaan[11] = cc([[w], rpt(bl, 3), rpt(p3, 5), rpt(bl, 5), [k, y1], rpt(p1, 3), [p2, p1, k, gy, p1 ,p1], rpt(gy, 9), [p1, p1, k, w]])
nyaan[12] = cc([[w], rpt(p3, 12), [k, k, y1, y1, p1, p2, p1, p1, k, gy, p1, p1, gy, k, gy, gy, k, gy, gy, k, gy, p1, p1, k, w]])
nyaan[13] = cc([[w], rpt(p3, 3), rpt(w, 5), rpt(p3, 2), rpt(k, 4), rpt(y1, 3), rpt(p1, 4), [k], rpt(gy, 3), rpt(k, 7), rpt(gy, 2), [k, w, w]])
nyaan[14] = cc([rpt(w, 10), [k, gy, gy, gy, k, k], rpt(y1, 7), [k], rpt(gy, 10), [k], rpt(w, 3)])
nyaan[15] = cc([rpt(w, 10), [k, gy, gy, k, w], rpt(k, 19), rpt(w, 4)])
nyaan[16] = cc([rpt(w, 10), rpt(k, 3), rpt(w, 3), [k, gy, gy, k, w, w, w, k, gy, gy, k, w, k, gy, gy, k], rpt(w, 6)])
nyaan[17] = cc([rpt(w, 17), rpt(k, 3), rpt(w, 4), rpt(k, 3), rpt(w, 2), rpt(k, 3), rpt(w, 6)])
nyaan[18] = rpt(w, 38)
for (var i = 0; i &lt; nyaan.length; i++) {
for (var j = 0; j &lt; nyaan[i].length; j++) {
nyaanHax.child(parseInt(startX+j) + &quot;:&quot; + parseInt(startY+i)).set(nyaan[i][j]);
}
}
return &quot;I drew a cat!&quot;
}
```</pre></noscript><script src="https://gist.github.com/0xdevalias/e8bb28726a37854606ad.js"> </script>
</code></pre>
In particular, the end part of the rendered noscript seems to be getting itself confused, and then ends up breaking the output:
```</pre></noscript><script src="https://gist.github.com/0xdevalias/e8bb28726a37854606ad.js"> </script>
</code></pre>
This doesn't appear to happen on other posts where I have gists embedded.
My theory is that maybe because the gist ends in a triple backtick codeblock (possibly with no newline?), that that may be breaking something within this plugin, that then flows on to breaking how commonmark parses/renders things?
This issue has been automatically marked as stale because it has not been commented on for at least two months.
The resources of the Jekyll team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.
This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.