From 95bfface99a917aaa466873ab3b050f9990dae68 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Wed, 23 May 2018 03:43:40 +0100 Subject: [PATCH] comment out broken logic for stripping p tags & bump dep --- package.json | 2 +- src/Markdown.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 79a3bf80e1..33bc75eff8 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "slate": "^0.33.4", "slate-react": "^0.12.4", "slate-html-serializer": "^0.6.1", - "slate-md-serializer": "matrix-org/slate-md-serializer#926a4c7", + "slate-md-serializer": "matrix-org/slate-md-serializer#1635f37", "sanitize-html": "^1.14.1", "text-encoding-utf-8": "^1.0.1", "url": "^0.11.0", diff --git a/src/Markdown.js b/src/Markdown.js index e67f4df4fd..2b16800d85 100644 --- a/src/Markdown.js +++ b/src/Markdown.js @@ -102,6 +102,7 @@ export default class Markdown { // (https://github.com/vector-im/riot-web/issues/3154) softbreak: '
', }); +/* const real_paragraph = renderer.paragraph; renderer.paragraph = function(node, entering) { @@ -114,16 +115,21 @@ export default class Markdown { real_paragraph.call(this, node, entering); } }; +*/ renderer.html_inline = html_if_tag_allowed; + renderer.html_block = function(node) { +/* // as with `paragraph`, we only insert line breaks // if there are multiple lines in the markdown. const isMultiLine = is_multi_line(node); - if (isMultiLine) this.cr(); +*/ html_if_tag_allowed.call(this, node); +/* if (isMultiLine) this.cr(); +*/ }; return renderer.render(this.parsed); @@ -150,6 +156,7 @@ export default class Markdown { this.lit(s); }; +/* renderer.paragraph = function(node, entering) { // as with toHTML, only append lines to paragraphs if there are // multiple paragraphs @@ -159,10 +166,12 @@ export default class Markdown { } } }; + renderer.html_block = function(node) { this.lit(node.literal); if (is_multi_line(node) && node.next) this.lit('\n\n'); }; +*/ // convert MD links into console-friendly ' < http://foo >' style links // ...except given this function never gets called with links, it's useless.