Skip to content

Commit d606a9c

Browse files
committed
[python-markdown] also fix execute-result processing
1 parent aef0a6a commit d606a9c

File tree

1 file changed

+3
-3
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/python-markdown

1 file changed

+3
-3
lines changed

src/jupyter_contrib_nbextensions/nbextensions/python-markdown/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ define([
9090
} else {
9191
html = marked(ul['text/plain']);
9292
// [\s\S] is used to also catch newlines
93-
var t = html.match(/<p>([\s\S]*?)<\/p>/)[1]; //strip <p> and </p> that marked adds and we don't want
94-
html = t ? t : html;
95-
var q = html.match(/&#39;([\s\S]*?)&#39;/); // strip quotes from strings
93+
var t = html.match(/^<p>([\s\S]*?)<\/p>$/); //strip <p> and </p> that marked adds and we don't want
94+
html = t !== null ? t[1] : html;
95+
var q = html.match(/^&#39;([\s\S]*?)&#39;$/); // strip quotes from strings
9696
if (q !== null) html = q[1]
9797
}
9898
}

0 commit comments

Comments
 (0)