##// END OF EJS Templates
Backport PR #5944: Markdown rendering bug fix....
MinRK -
Show More
@@ -252,7 +252,7 b' var IPython = (function (IPython) {'
252 var html = marked.parser(marked.lexer(text));
252 var html = marked.parser(marked.lexer(text));
253 html = IPython.mathjaxutils.replace_math(html, math);
253 html = IPython.mathjaxutils.replace_math(html, math);
254 html = security.sanitize_html(html);
254 html = security.sanitize_html(html);
255 html = $(html);
255 html = $($.parseHTML(html));
256 // links in markdown cells should open in new tabs
256 // links in markdown cells should open in new tabs
257 html.find("a[href]").not('[href^="#"]').attr("target", "_blank");
257 html.find("a[href]").not('[href^="#"]').attr("target", "_blank");
258 this.set_rendered(html);
258 this.set_rendered(html);
@@ -429,7 +429,7 b' var IPython = (function (IPython) {'
429 var html = marked.parser(marked.lexer(text));
429 var html = marked.parser(marked.lexer(text));
430 html = IPython.mathjaxutils.replace_math(html, math);
430 html = IPython.mathjaxutils.replace_math(html, math);
431 html = security.sanitize_html(html);
431 html = security.sanitize_html(html);
432 var h = $(html);
432 var h = $($.parseHTML(html));
433 // add id and linkback anchor
433 // add id and linkback anchor
434 var hash = h.text().replace(/ /g, '-');
434 var hash = h.text().replace(/ /g, '-');
435 h.attr('id', hash);
435 h.attr('id', hash);
@@ -10,7 +10,7 b' casper.notebook_test(function () {'
10 cell.render();
10 cell.render();
11 return cell.get_rendered();
11 return cell.get_rendered();
12 });
12 });
13 this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
13 this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
14
14
15 // Test menubar entries.
15 // Test menubar entries.
16 output = this.evaluate(function () {
16 output = this.evaluate(function () {
@@ -21,7 +21,7 b' casper.notebook_test(function () {'
21 $('#run_cell').mouseenter().click();
21 $('#run_cell').mouseenter().click();
22 return cell.get_rendered();
22 return cell.get_rendered();
23 });
23 });
24 this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
24 this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
25
25
26 // Test toolbar buttons.
26 // Test toolbar buttons.
27 output = this.evaluate(function () {
27 output = this.evaluate(function () {
@@ -32,5 +32,5 b' casper.notebook_test(function () {'
32 $('#run_b').click();
32 $('#run_b').click();
33 return cell.get_rendered();
33 return cell.get_rendered();
34 });
34 });
35 this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
35 this.test.assertEquals(output.trim(), '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
36 });
36 });
General Comments 0
You need to be logged in to leave comments. Login now