update(codeblock & header)

This commit is contained in:
yanmao 2021-12-28 16:36:09 +08:00
parent 37ebb1a6a6
commit 31e039d506
4 changed files with 3 additions and 6 deletions

View File

@ -89,6 +89,7 @@ class CodeBlcok<V extends CodeBlockValue = CodeBlockValue> extends Card<V> {
} }
#viewAutoWrap?: boolean = undefined; #viewAutoWrap?: boolean = undefined;
toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions> { toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions> {
if (this.loading) return [];
if (!isEngine(this.editor) || this.editor.readonly) { if (!isEngine(this.editor) || this.editor.readonly) {
return [ return [
{ type: 'copy' }, { type: 'copy' },

View File

@ -86,6 +86,7 @@ class CodeBlcok<V extends CodeBlockValue = CodeBlockValue> extends Card<V> {
} }
#viewAutoWrap?: boolean = undefined; #viewAutoWrap?: boolean = undefined;
toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions> { toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions> {
if (this.loading) return [];
if (!isEngine(this.editor) || this.editor.readonly) { if (!isEngine(this.editor) || this.editor.readonly) {
return [ return [
{ type: 'copy' }, { type: 'copy' },

View File

@ -114,11 +114,6 @@ export default class<T extends HeadingOptions> extends BlockPlugin<T> {
this.editor.on('paste:markdown', (child) => this.editor.on('paste:markdown', (child) =>
this.pasteMarkdown(child), this.pasteMarkdown(child),
); );
this.editor.on('paste:each', (node) => {
if (this.tagName.indexOf(node.name) > -1) {
node.attributes('id', '');
}
});
} }
//引擎处理 //引擎处理
if (!isEngine(this.editor) || this.options.showAnchor === false) return; if (!isEngine(this.editor) || this.options.showAnchor === false) return;

View File

@ -39,7 +39,7 @@ class Outline {
if (!children) return []; if (!children) return [];
let headings: Array<Element> = []; let headings: Array<Element> = [];
children.each((child) => { children.each((child) => {
if (!filter[child.nodeName]) return; if (!filter[child.nodeName.toLowerCase()]) return;
headings.push(child as Element); headings.push(child as Element);
}); });
return headings; return headings;