Make table cells at least 3 char long

This commit is contained in:
Laurent Cozic
2018-05-21 23:55:53 +01:00
parent 90cff86ac0
commit 36179a8394
2 changed files with 4 additions and 1 deletions

View File

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