[python-markdown] allow whitespace before/after wrapping <p> tags

This commit is contained in:
Josh Barnes
2017-10-12 01:52:38 +01:00
parent d606a9c353
commit 4a1279bfff
@@ -63,7 +63,7 @@ define([
html = marked(text);
} else if (out_data.msg_type === "stream") {
html = marked(out_data.content.text);
var t = html.match(/^<p>([\s\S]*?)<\/p>$/); //strip <p> and </p> that marked (maybe) adds and we don't want
var t = html.match(/^\s*<p>([\s\S]*?)<\/p>\s*$/); //strip <p> and </p> that marked (maybe) adds and we don't want
html = t !== null ? t[1] : html;
var q = html.match(/^&#39;([\s\S]*?)&#39;$/); // strip quotes from strings
if (q !== null) html = q[1]
@@ -90,7 +90,7 @@ define([
} else {
html = marked(ul['text/plain']);
// [\s\S] is used to also catch newlines
var t = html.match(/^<p>([\s\S]*?)<\/p>$/); //strip <p> and </p> that marked adds and we don't want
var t = html.match(/^\s*<p>([\s\S]*?)<\/p>\s*$/); //strip <p> and </p> that marked adds and we don't want
html = t !== null ? t[1] : html;
var q = html.match(/^&#39;([\s\S]*?)&#39;$/); // strip quotes from strings
if (q !== null) html = q[1]