Skip to content

Commit 2de4e88

Browse files
committed
fix(yfmCut): deleted open attr
1 parent 1267c9f commit 2de4e88

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/extensions/yfm/YfmCut/YfmCutSpecs/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const getSchemaSpecs = (
1515
placeholder?: PlaceholderOptions,
1616
): Record<CutNode, NodeSpec> => ({
1717
[CutNode.Cut]: {
18-
attrs: {class: {default: 'yfm-cut'}, open: {default: null}},
18+
attrs: {class: {default: 'yfm-cut'}},
1919
content: `${CutNode.CutTitle} ${CutNode.CutContent}`,
2020
group: 'block yfm-cut',
2121
parseDOM: [{tag: '.yfm-cut'}],

src/extensions/yfm/YfmCut/actions/toYfmCut.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {ActionSpec} from '../../../../core';
66
import {cutContentType, cutTitleType, cutType} from '../const';
77

88
const createYfmCutNode = (schema: Schema) => (content?: Node | Node[] | Fragment) => {
9-
return cutType(schema).create({class: 'yfm-cut open', open: true}, [
9+
return cutType(schema).create({class: 'yfm-cut open'}, [
1010
cutTitleType(schema).create(null),
1111
cutContentType(schema).create(null, content),
1212
]);

src/extensions/yfm/YfmCut/plugins/auto-open.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function openParentYfmCuts($pos: ResolvedPos, domAtPos: EditorView['domAtPos']):
4444
if ($pos.node(depth - 1).type === cutType(schema)) {
4545
const {node: cutDomNode} = domAtPos($pos.start(depth - 1), 0);
4646
(cutDomNode as Element).classList.add('open');
47-
(cutDomNode as Element).setAttribute('open', 'true');
4847
depth--;
4948
}
5049
}
@@ -105,7 +104,6 @@ class CutAutoOpenOnDragOver implements PluginView {
105104
private _openCut() {
106105
if (this._editorView.dragging) {
107106
this._cutElem?.classList.add('open');
108-
this._cutElem?.setAttribute('open', 'true');
109107
}
110108
this._clear();
111109
}

0 commit comments

Comments
 (0)