File tree Expand file tree Collapse file tree
packages/core/src/blocks/Code
tests/src/unit/core/formatConversion/parse Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,7 @@ export const createCodeBlockSpec = createBlockSpec(
102102 const code = el . firstElementChild ! ;
103103
104104 return parser . parse ( code , {
105+ preserveWhitespace : "full" ,
105106 topNode : schema . nodes [ "codeBlock" ] . create ( ) ,
106107 } ) . content ;
107108 } ,
Original file line number Diff line number Diff line change 1+ [
2+ {
3+ "children" : [],
4+ "content" : [
5+ {
6+ "styles" : {},
7+ "text" : " console.log(" First Line")
8+ console.log("Second Line")
9+ console.log("Third Line")",
10+ "type" : " text" ,
11+ },
12+ ],
13+ "id" : " 1" ,
14+ "props" : {
15+ "language" : " text" ,
16+ },
17+ "type" : " codeBlock" ,
18+ },
19+ ]
Original file line number Diff line number Diff line change @@ -814,6 +814,15 @@ With Hard Break</p>
814814 } ,
815815 executeTest : testParseHTML ,
816816 } ,
817+ {
818+ testCase : {
819+ name : "codeBlocksMultiLine" ,
820+ content : `<pre><code>console.log("First Line")
821+ console.log("Second Line")
822+ console.log("Third Line")</code></pre>` ,
823+ } ,
824+ executeTest : testParseHTML ,
825+ } ,
817826 {
818827 testCase : {
819828 name : "basicBlockquote" ,
You can’t perform that action at this time.
0 commit comments