update: parser 解析html移除 isEngine 限制
This commit is contained in:
parent
c12a1f4d19
commit
b6e8b6fc64
|
@ -9,7 +9,7 @@ import { RangeInterface, RangePath } from '../types/range';
|
|||
import ChangeEvent from './event';
|
||||
import Parser from '../parser';
|
||||
import { ANCHOR_SELECTOR, CURSOR_SELECTOR, FOCUS_SELECTOR } from '../constants';
|
||||
import { combinText, transformCustomTags } from '../utils';
|
||||
import { combinText } from '../utils';
|
||||
import { TRIGGER_CARD_ID } from '../constants/card';
|
||||
import { DATA_ID, EDITABLE_SELECTOR, UI_SELECTOR } from '../constants/root';
|
||||
import { SelectionInterface } from '../types/selection';
|
||||
|
|
|
@ -25,7 +25,6 @@ export default class<T extends FileOptions = FileOptions> extends Plugin<T> {
|
|||
|
||||
init() {
|
||||
this.editor.language.add(locales);
|
||||
if (!isEngine(this.editor)) return;
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
|
|
|
@ -55,7 +55,6 @@ export default class Math<
|
|||
|
||||
init() {
|
||||
this.editor.language.add(locales);
|
||||
if (!isEngine(this.editor)) return;
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
|
|
|
@ -24,14 +24,14 @@ class MentionPlugin<
|
|||
}
|
||||
|
||||
init() {
|
||||
this.editor.on('parse:value', (node) => this.paserValue(node));
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
this.pasteSchema(schema),
|
||||
);
|
||||
if (isEngine(this.editor)) {
|
||||
this.editor.on('keydown:at', (event) => this.onAt(event));
|
||||
this.editor.on('parse:value', (node) => this.paserValue(node));
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
this.pasteSchema(schema),
|
||||
);
|
||||
}
|
||||
this.editor.language.add(locales);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ export default class<
|
|||
|
||||
init() {
|
||||
this.editor.language.add(locales);
|
||||
if (!isEngine(this.editor)) return;
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
|
|
|
@ -13,13 +13,13 @@ import {
|
|||
CARD_VALUE_KEY,
|
||||
CARD_SELECTOR,
|
||||
transformCustomTags,
|
||||
READY_CARD_SELECTOR,
|
||||
} from '@aomao/engine';
|
||||
import TableComponent, { Template, Helper } from './component';
|
||||
import locales from './locale';
|
||||
import { TableInterface, TableOptions, TableValue } from './types';
|
||||
import './index.css';
|
||||
import { DATA_ID } from '@aomao/engine';
|
||||
import { CardInterface } from '@aomao/engine';
|
||||
class Table<T extends TableOptions = TableOptions> extends Plugin<T> {
|
||||
static get pluginName() {
|
||||
return 'table';
|
||||
|
@ -493,10 +493,7 @@ class Table<T extends TableOptions = TableOptions> extends Plugin<T> {
|
|||
node.remove();
|
||||
return;
|
||||
} else {
|
||||
const cards = table.find(CARD_SELECTOR).toArray();
|
||||
cards.forEach((componentNode) => {
|
||||
this.editor.trigger('parse:html', componentNode);
|
||||
});
|
||||
this.editor.trigger('parse:html', table);
|
||||
}
|
||||
}
|
||||
const width = table.attributes('width') || table.css('width');
|
||||
|
|
|
@ -31,7 +31,6 @@ export default class VideoPlugin<
|
|||
|
||||
init() {
|
||||
this.editor.language.add(locales);
|
||||
if (!isEngine(this.editor)) return;
|
||||
this.editor.on('parse:html', (node) => this.parseHtml(node));
|
||||
this.editor.on('paste:each', (child) => this.pasteHtml(child));
|
||||
this.editor.on('paste:schema', (schema: SchemaInterface) =>
|
||||
|
|
Loading…
Reference in New Issue