Fix WYWIWYG Table cell adding new line in table cell (#15594)

* fixes new line in table cell

* add test and fix for table head
This commit is contained in:
Vasu Bhog
2021-05-28 13:47:50 -07:00
committed by GitHub
parent c6fec97819
commit 1de05a2339
2 changed files with 11 additions and 0 deletions

View File

@@ -176,6 +176,10 @@ export class HTMLMarkdownConverter {
replacement: function (content, node, options) {
// For elements that aren't lists, convert <br> into its markdown equivalent
if (node.parentElement?.nodeName !== 'LI') {
// Keeps <br> in table cell/head in order to keep new linehow
if (node.parentElement?.nodeName === 'TD' || node.parentElement?.nodeName === 'TH') {
return '<br>';
}
return options.br + '\n';
}
// One (and only one) line break is ignored when it's inside of a list item