From 4bd87a170dc1869f6dd23fbe88da20511389ff40 Mon Sep 17 00:00:00 2001 From: Ian Wilson Date: Fri, 4 Nov 2016 12:39:06 -0400 Subject: [PATCH] Update pygments regex to include optional span at end - Fixes #107 at jbt/docker --- src/docker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docker.js b/src/docker.js index 4b3d819..d6f8276 100644 --- a/src/docker.js +++ b/src/docker.js @@ -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*
/,'').replace(/<\/pre><\/div>\s*$/,'');
-    var bits = out.split(/^]*>[^<]+(?:<\/span>]*>)?----DIVIDER----[^<]*<\/span>$/gm);
+    var bits = out.split(/^]*>[^<]+(?:<\/span>]*>)?----DIVIDER----[^<]*(?:<\/span>]*>)?<\/span>$/gm);
     for(var i = 0; i < sections.length; i += 1){
       sections[i].codeHtml = '
' + bits[i] + '
'; sections[i].docHtml = showdown.makeHtml(sections[i].docs);