From ec14f697af41c46f0c946ee606b5a97de7c2f05f Mon Sep 17 00:00:00 2001 From: Christian Saucier <01010110@flaxscrip.nu> Date: Thu, 2 Oct 2014 11:19:59 -0400 Subject: [PATCH] Fix .md table pipe parsing The regex that populates "matches" gets confused when a markdown table pipe ("|") is directly followed by a markdown double bracket link tag ("[["). Inserting spaces around the pipe allows the regex to parse the markdown text properly. ex: | column 1 | column 2 |[[link]]| // The link will work but it will be mistakenly rendered as part of column 2 in the HTML output. --- lib/renderer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/renderer.js b/lib/renderer.js index 0a2430aa..37a551f7 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -61,6 +61,8 @@ function extractTags(text) { tagmap = {}; + text = text.replace(/\|/g, " | "); // Spaces provide easier parsing of .md table pipes + var matches = text.match(/(.?)\[\[(.+?)\]\]([^\[]?)/g), tag, id;