From 3a91b076e121175b4a20d50f0499276c40008a4b Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Tue, 15 May 2012 11:06:36 -0600 Subject: [PATCH] Fix gollum code blocks. --- .../gollum/livepreview/js/pagedown/Markdown.Converter.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/pagedown/Markdown.Converter.js b/lib/gollum/frontend/public/gollum/livepreview/js/pagedown/Markdown.Converter.js index c0a6002e..8bb02cd6 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/js/pagedown/Markdown.Converter.js +++ b/lib/gollum/frontend/public/gollum/livepreview/js/pagedown/Markdown.Converter.js @@ -1024,9 +1024,10 @@ else function _DoCodeSpansGollum(text) { // // Gollum wraps code in one pre. Use ` to mark code pre. + // Gollum requires exactly three starting and ending `. // All regex set to use 'm' multiline option. // - text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm, + text = text.replace(/(^|[^\\])(`{3})([^\r]*?[^`])\2(?!`)/gm, function (wholeMatch, m1, m2, m3, m4) { var c = m3; c = c.replace(/^([ \t]*)/gm, ""); // leading whitespace