File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
src/extensions/yfm/YfmCut Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff 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 :
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff 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' ) ;
You can’t perform that action at this time.
0 commit comments