diff --git a/node_modules/gfm/showdown.js b/node_modules/gfm/showdown.js index 324b81db..facd58d9 100644 --- a/node_modules/gfm/showdown.js +++ b/node_modules/gfm/showdown.js @@ -101,6 +101,8 @@ var g_html_blocks; // (see _ProcessListItems() for details): var g_list_level = 0; +// == CJS == Allow hardwrapping to be disabled. +var g_hardwrap; this.makeHtml = function(text) { // @@ -118,6 +120,9 @@ this.makeHtml = function(text) { g_titles = new Array(); g_html_blocks = new Array(); + // == CJS == Allow hardwrapping to be disabled. + g_hardwrap = typeof this.hardwrap === "undefined" || this.hardwrap; + // attacklab: Replace ~ with ~T // This lets us use tilde as an escape char to avoid md5 hashes // The choice of character is arbitray; anything that isn't @@ -1140,7 +1145,8 @@ var _FormParagraphs = function(text) { } else if (str.search(/\S/) >= 0) { str = _RunSpanGamut(str); - str = str.replace(/\n/g,"
"); // ** GFM ** + // == CJS == Allow hardwrapping to be disabled. + if (g_hardwrap) str = str.replace(/\n/g,"
"); // ** GFM ** str = str.replace(/^([ \t]*)/g,"

"); str += "

" grafsOut.push(str); diff --git a/plugins/markdown.js b/plugins/markdown.js index 64d08550..bcb8f133 100644 --- a/plugins/markdown.js +++ b/plugins/markdown.js @@ -28,6 +28,7 @@ function getParser(parser, conf) { parser = new (require("gfm/showdown").Converter)(); parser.githubRepoOwner = conf.githubRepoOwner; parser.githubRepoName = conf.githubRepoName; + parser.hardwrap = !!conf.gfmHardwrap; return function(source) { return parser.makeHtml(source);