Skip to content

Commit

Permalink
Update pygments regex to include optional span at end - Fixes jbt#107
Browse files Browse the repository at this point in the history
…at jbt/docker
  • Loading branch information
iabw committed Nov 4, 2016
1 parent e58fb39 commit 4bd87a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ Docker.prototype.highlight = function(sections, language, cb){
// Run our input through pygments, then split the output back up into its constituent sections
this.pygments(input, pygment, function(out){
out = out.replace(/^\s*<div class="highlight"><pre>/,'').replace(/<\/pre><\/div>\s*$/,'');
var bits = out.split(/^<span[^>]*>[^<]+(?:<\/span><span[^>]*>)?----DIVIDER----[^<]*<\/span>$/gm);
var bits = out.split(/^<span[^>]*>[^<]+(?:<\/span><span[^>]*>)?----DIVIDER----[^<]*(?:<\/span><span[^>]*>)?<\/span>$/gm);
for(var i = 0; i < sections.length; i += 1){
sections[i].codeHtml = '<div class="highlight"><pre>' + bits[i] + '</pre></div>';
sections[i].docHtml = showdown.makeHtml(sections[i].docs);
Expand Down

0 comments on commit 4bd87a1

Please sign in to comment.