update(codeblock & header)
This commit is contained in:
parent
37ebb1a6a6
commit
31e039d506
|
@ -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' },
|
||||||
|
|
|
@ -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' },
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue