fix: table markdown parse
This commit is contained in:
parent
a53e5db82e
commit
48d6a8ac71
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue