You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for the library, been using it for a while. I just wanted to document this problem I ran into, even though it's for the last version and from what I can tell completely inapplicable to v1.
I figured I'd be able to easily add it, but it was breaking rather bizarrely due to the highlighted HTML that Pygments outputs not matching the regex used to split its output. As a result, the code was being output in a giant clump in the first section, with all the '----DIVIDER----' comments intact, and all the rest of the sections had 'undefined' for their code.
The html the regex expected (and was being generated for other languages) looked like <span class="err">##</span><span class="x">----DIVIDER----</span>
and what I was getting was <span class="cp">##</span><span class="c">----DIVIDER----</span><span class="x"></span>
I fixed this by changing that regex line at docker.js#L1061 to var bits = out.split(/^<span[^>]*>[^<]+(?:<\/span><span[^>]*>)?----DIVIDER----[^<]*(?:<\/span><span[^>]*>)?<\/span>$/gm);
This just copies the same optional span detecting block after the DIVIDER block, and now it works.
The text was updated successfully, but these errors were encountered:
iabw
added a commit
to iabw/docker
that referenced
this issue
Nov 4, 2016
First, thanks for the library, been using it for a while. I just wanted to document this problem I ran into, even though it's for the last version and from what I can tell completely inapplicable to v1.
I was looking to add the Velocity templating language to the available languages in version 0.2.x
I figured I'd be able to easily add it, but it was breaking rather bizarrely due to the highlighted HTML that Pygments outputs not matching the regex used to split its output. As a result, the code was being output in a giant clump in the first section, with all the '----DIVIDER----' comments intact, and all the rest of the sections had 'undefined' for their code.
The html the regex expected (and was being generated for other languages) looked like
<span class="err">##</span><span class="x">----DIVIDER----</span>
and what I was getting was
<span class="cp">##</span><span class="c">----DIVIDER----</span><span class="x"></span>
I fixed this by changing that regex line at docker.js#L1061 to
var bits = out.split(/^<span[^>]*>[^<]+(?:<\/span><span[^>]*>)?----DIVIDER----[^<]*(?:<\/span><span[^>]*>)?<\/span>$/gm);
This just copies the same optional span detecting block after the DIVIDER block, and now it works.
The text was updated successfully, but these errors were encountered: