Replace newlines inside table cells so that resulting markdown is valid

This commit is contained in:
Laurent Cozic
2018-05-21 23:42:02 +01:00
parent 0f64fe53cb
commit 7af39b57f0
3 changed files with 5 additions and 1 deletions

View File

@@ -99,7 +99,7 @@ function cell (content, node) {
var index = indexOf.call(node.parentNode.childNodes, node)
var prefix = ' '
if (index === 0) prefix = '| '
return prefix + content + ' |'
return prefix + content.trim().replace(/[\n\r]/g, "<br>") + ' |'
}
function nodeContainsTable(node) {