Skip to content

Commit 1267c9f

Browse files
committed
fix(yfmCut): reverted details, summary tags
1 parent 614a4c3 commit 1267c9f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getSchemaSpecs = (
2020
group: 'block yfm-cut',
2121
parseDOM: [{tag: '.yfm-cut'}],
2222
toDOM(node) {
23-
return ['details', node.attrs, 0];
23+
return ['div', node.attrs, 0];
2424
},
2525
selectable: true,
2626
allowSelection: true,
@@ -34,7 +34,7 @@ export const getSchemaSpecs = (
3434
group: 'block yfm-cut',
3535
parseDOM: [{tag: '.yfm-cut-title'}],
3636
toDOM(node) {
37-
return ['summary', node.attrs, 0];
37+
return ['div', node.attrs, 0];
3838
},
3939
placeholder: {
4040
content:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
.yfm-cut-title .g-md-yfm-cut-title-inner {
22
cursor: text;
33
}
4+
5+
// FIXME: Restore the cut-extension mapping after the fix:
6+
// when using <details> and <summary> tags, the click does
7+
// not work correctly on the placeholder
8+
9+
.yfm-cut-content {
10+
display: none;
11+
overflow: hidden;
12+
13+
transition: height 0.3s ease-in-out;
14+
}
15+
16+
.open > .yfm-cut-content {
17+
display: revert;
18+
}

src/extensions/yfm/YfmCut/nodeviews/yfm-cut-title.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class YfmCutTitleNodeView implements NodeView {
1212
constructor(node: Node) {
1313
this.node = node;
1414

15-
this.dom = document.createElement('summary');
15+
this.dom = document.createElement('div');
1616
this.dom.classList.add('yfm-cut-title');
1717
this.dom.replaceChildren((this.contentDOM = document.createElement('div')));
1818
this.contentDOM.classList.add('g-md-yfm-cut-title-inner');

0 commit comments

Comments
 (0)