fix: table markdown parse

This commit is contained in:
yanmao 2022-01-07 14:43:30 +08:00
parent a53e5db82e
commit 48d6a8ac71
4 changed files with 4 additions and 4 deletions

View File

@ -905,7 +905,7 @@ class CardModel implements CardModelInterface {
}
if (nextBlock.attributes(CARD_KEY)) {
this.editor.card.find(nextBlock)?.focus(range, false);
this.editor.card.find(nextBlock)?.focus(range, true);
return;
}
}

View File

@ -118,7 +118,7 @@ export default class<T extends OrderedListOptions> extends ListPlugin<T> {
const text = node.text();
if (!text) return;
const reg = /(^|\r\n|\n)\s*(\d{1,9}\.)/;
const reg = /(^|\r\n|\n)\s*(\d{1,9}\.\s+)/;
const match = reg.exec(text);
return {
reg,

View File

@ -528,7 +528,7 @@ class TableComponent<V extends TableValue = TableValue>
});
});
const { rows, cols, height, width } = tableModel;
const html = parser.toValue(schema, conversion, false, true);
const html = parser.toValue(schema, conversion, false, false);
return {
...value,
rows,

View File

@ -488,7 +488,7 @@ class Table<T extends TableOptions = TableOptions> extends Plugin<T> {
const text = node.text();
if (!text) return;
// 匹配 |-|-| 或者 -|- 或者 |-|- 或者 -|-|
const reg = /(?:\|)+\n\s*(\|?(\s*:?-+:?\s*)+\|?)+\s*(\n|$)/;
const reg = /\n\s*(\|?(\s*:?-+:?\s*)+\|?)+\s*(\n|$)/;
const tbMatch = reg.exec(text);
if (!tbMatch || tbMatch[0].indexOf('|') < 0) return;
return {