@@ -25,7 +25,7 @@ const {schema, parser, serializer} = new ExtensionsManager({
2525 . use ( ImageSpecs ) ,
2626} ) . buildDeps ( ) ;
2727
28- const { doc, p, i, bq, img, note, noteTitle} = builders ( schema , {
28+ const { doc, p, i, bq, img, note, noteTitle, noteContent } = builders ( schema , {
2929 doc : { nodeType : BaseNode . Doc } ,
3030 p : { nodeType : BaseNode . Paragraph } ,
3131 i : { markType : italicMarkName } ,
@@ -37,7 +37,8 @@ const {doc, p, i, bq, img, note, noteTitle} = builders(schema, {
3737 [ NoteAttrs . Class ] : 'yfm-note yfm-accent-info' ,
3838 } ,
3939 noteTitle : { nodeType : NoteNode . NoteTitle } ,
40- } ) as PMTestBuilderResult < 'doc' | 'p' | 'bq' | 'img' | 'note' | 'noteTitle' , 'i' > ;
40+ noteContent : { nodeType : NoteNode . NoteContent } ,
41+ } ) as PMTestBuilderResult < 'doc' | 'p' | 'bq' | 'img' | 'note' | 'noteTitle' | 'noteContent' , 'i' > ;
4142
4243const { same} = createMarkupChecker ( { parser, serializer} ) ;
4344
@@ -53,7 +54,10 @@ note content 2
5354{% endnote %}
5455` . trim ( ) ;
5556
56- same ( markup , doc ( note ( noteTitle ( 'note title' ) , p ( 'note content' ) , p ( 'note content 2' ) ) ) ) ;
57+ same (
58+ markup ,
59+ doc ( note ( noteTitle ( 'note title' ) , noteContent ( p ( 'note content' ) , p ( 'note content 2' ) ) ) ) ,
60+ ) ;
5761 } ) ;
5862
5963 it ( 'should parse nested yfm-notes' , ( ) => {
@@ -71,7 +75,12 @@ note content
7175
7276 same (
7377 markup ,
74- doc ( note ( noteTitle ( 'note title' ) , note ( noteTitle ( 'note title 2' ) , p ( 'note content' ) ) ) ) ,
78+ doc (
79+ note (
80+ noteTitle ( 'note title' ) ,
81+ noteContent ( note ( noteTitle ( 'note title 2' ) , noteContent ( p ( 'note content' ) ) ) ) ,
82+ ) ,
83+ ) ,
7584 ) ;
7685 } ) ;
7786
@@ -84,7 +93,7 @@ note content
8493> {% endnote %}
8594` . trim ( ) ;
8695
87- same ( markup , doc ( bq ( note ( noteTitle ( 'note title' ) , p ( 'note content' ) ) ) ) ) ;
96+ same ( markup , doc ( bq ( note ( noteTitle ( 'note title' ) , noteContent ( p ( 'note content' ) ) ) ) ) ) ;
8897 } ) ;
8998
9099 it ( 'should parse yfm-note with inline markup in note title' , ( ) => {
@@ -96,7 +105,7 @@ note content
96105{% endnote %}
97106 ` . trim ( ) ;
98107
99- same ( markup , doc ( note ( noteTitle ( i ( 'note italic title' ) ) , p ( 'note content' ) ) ) ) ;
108+ same ( markup , doc ( note ( noteTitle ( i ( 'note italic title' ) ) , noteContent ( p ( 'note content' ) ) ) ) ) ;
100109 } ) ;
101110
102111 it ( 'should parse yfm-note with inline node in note title' , ( ) => {
@@ -118,7 +127,7 @@ note content
118127 [ ImageAttr . Alt ] : 'img' ,
119128 } ) ,
120129 ) ,
121- p ( 'note content' ) ,
130+ noteContent ( p ( 'note content' ) ) ,
122131 ) ,
123132 ) ,
124133 ) ;
@@ -132,7 +141,7 @@ note content
132141 '<p class="yfm-note-title">YfmNote title</p>' +
133142 '<p>YfmNote content</p>' +
134143 '</div></div>' ,
135- doc ( note ( noteTitle ( 'YfmNote title' ) , p ( 'YfmNote content' ) ) ) ,
144+ doc ( note ( noteTitle ( 'YfmNote title' ) , noteContent ( p ( 'YfmNote content' ) ) ) ) ,
136145 ) ;
137146 } ) ;
138147} ) ;
0 commit comments