fix(makeMarkdown): handle <br> tags converting html to markdown

Convert <br> tags to 2 spaces + newline rather than leaving the tag
in place when converting HTML to MD
This commit is contained in:
David Chester 2019-01-01 15:22:49 -05:00 committed by Estevão Soares dos Santos
parent 82f90ebda2
commit 201969473a
4 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,5 @@
showdown.subParser('makeMarkdown.break', function () {
'use strict';
return ' \n';
});

View File

@ -109,6 +109,10 @@ showdown.subParser('makeMarkdown.node', function (node, globals, spansOnly) {
txt = showdown.subParser('makeMarkdown.image')(node, globals);
break;
case 'br':
txt = showdown.subParser('makeMarkdown.break')(node, globals);
break;
default:
txt = node.outerHTML + '\n\n';
}

View File

@ -0,0 +1 @@
first line<br />and the second

View File

@ -0,0 +1,2 @@
first line
and the second