fix(table): 换行会被算作单独的单元格
This commit is contained in:
parent
f18cd5e7c6
commit
5848342a83
|
@ -386,7 +386,12 @@ class Table<T extends TableOptions = TableOptions> extends Plugin<T> {
|
|||
const childNodes = tr.children();
|
||||
childNodes.each((tdChild) => {
|
||||
const td = $(tdChild);
|
||||
if (td.name !== 'td') {
|
||||
const text = td.text();
|
||||
// 排除空格
|
||||
if (
|
||||
td.name !== 'td' &&
|
||||
['\n', '\r\n'].includes(text.trim())
|
||||
) {
|
||||
const newTd = $(`<td></td>`);
|
||||
td.before(newTd);
|
||||
newTd.append(td);
|
||||
|
|
Loading…
Reference in New Issue