File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/jupyter_contrib_nbextensions/nbextensions/python-markdown Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,9 @@ define([
63
63
html = marked ( text ) ;
64
64
} else if ( out_data . msg_type === "stream" ) {
65
65
html = marked ( out_data . content . text ) ;
66
- var t = html . match ( / < p > ( [ \s \S ] * ?) < \/ p > / ) [ 1 ] ; //strip <p> and </p> that marked adds and we don't want
67
- html = t ? t : html ;
68
- var q = html . match ( / & # 3 9 ; ( [ \s \S ] * ?) & # 3 9 ; / ) ; // strip quotes from strings
66
+ var t = html . match ( / ^ \s * < p > ( [ \s \S ] * ?) < \/ p > \s * $ / ) ; //strip <p> and </p> that marked (maybe) adds and we don't want
67
+ html = t !== null ? t [ 1 ] : html ;
68
+ var q = html . match ( / ^ & # 3 9 ; ( [ \s \S ] * ?) & # 3 9 ; $ / ) ; // strip quotes from strings
69
69
if ( q !== null ) html = q [ 1 ]
70
70
} else if ( out_data . msg_type === "execute_result" | out_data . msg_type === "display_data" ) {
71
71
var ul = out_data . content . data ;
@@ -90,9 +90,9 @@ define([
90
90
} else {
91
91
html = marked ( ul [ 'text/plain' ] ) ;
92
92
// [\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 ( / & # 3 9 ; ( [ \s \S ] * ?) & # 3 9 ; / ) ; // strip quotes from strings
93
+ var t = html . match ( / ^ \s * < p > ( [ \s \S ] * ?) < \/ p > \s * $ / ) ; //strip <p> and </p> that marked adds and we don't want
94
+ html = t !== null ? t [ 1 ] : html ;
95
+ var q = html . match ( / ^ & # 3 9 ; ( [ \s \S ] * ?) & # 3 9 ; $ / ) ; // strip quotes from strings
96
96
if ( q !== null ) html = q [ 1 ]
97
97
}
98
98
}
You can’t perform that action at this time.
0 commit comments