[python-markdown] only strip p-tags or quotes from beginning & end

This commit is contained in:
Josh Barnes
2017-10-12 01:34:55 +01:00
parent 172ecd1005
commit aef0a6a7bd
@@ -63,9 +63,9 @@ 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(/^<p>([\s\S]*?)<\/p>$/); //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
var q = html.match(/^&#39;([\s\S]*?)&#39;$/); // strip quotes from strings
if (q !== null) html = q[1]
} else if (out_data.msg_type === "execute_result" | out_data.msg_type === "display_data" ) {
var ul = out_data.content.data;