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;
toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions> {
if (this.loading) return [];
if (!isEngine(this.editor) || this.editor.readonly) {
return [
{ type: 'copy' },

View File

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

View File

@ -114,11 +114,6 @@ export default class<T extends HeadingOptions> extends BlockPlugin<T> {
this.editor.on('paste:markdown', (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;

View File

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