File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
notebook/static/notebook/js Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -713,7 +713,15 @@ define([
713
713
var text_and_math = mathjaxutils . remove_math ( markdown ) ;
714
714
var text = text_and_math [ 0 ] ;
715
715
var math = text_and_math [ 1 ] ;
716
- marked ( text , function ( err , html ) {
716
+ // Prevent marked from returning inline styles for table cells
717
+ var renderer = new marked . Renderer ( ) ;
718
+ renderer . tablecell = function ( content , flags ) {
719
+ var type = flags . header ? 'th' : 'td' ;
720
+ var start_tag = '<' + type + '>' ;
721
+ var end_tag = '</' + type + '>\n' ;
722
+ return start_tag + content + end_tag ;
723
+ } ;
724
+ marked ( text , { renderer : renderer } , function ( err , html ) {
717
725
html = mathjaxutils . replace_math ( html , math ) ;
718
726
toinsert . append ( html ) ;
719
727
} ) ;
Original file line number Diff line number Diff line change @@ -393,7 +393,15 @@ define([
393
393
var text_and_math = mathjaxutils . remove_math ( text ) ;
394
394
text = text_and_math [ 0 ] ;
395
395
math = text_and_math [ 1 ] ;
396
- marked ( text , function ( err , html ) {
396
+ // Prevent marked from returning inline styles for table cells
397
+ var renderer = new marked . Renderer ( ) ;
398
+ renderer . tablecell = function ( content , flags ) {
399
+ var type = flags . header ? 'th' : 'td' ;
400
+ var start_tag = '<' + type + '>' ;
401
+ var end_tag = '</' + type + '>\n' ;
402
+ return start_tag + content + end_tag ;
403
+ } ;
404
+ marked ( text , { renderer : renderer } , function ( err , html ) {
397
405
html = mathjaxutils . replace_math ( html , math ) ;
398
406
html = security . sanitize_html ( html ) ;
399
407
html = $ ( $ . parseHTML ( html ) ) ;
You can’t perform that action at this time.
0 commit comments