Skip to content

Commit c2cbc30

Browse files
committed
fix: add more lenient parsing for code blocks, to accept newlines #2105
1 parent 8225736 commit c2cbc30

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/core/src/blocks/Code/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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
},

0 commit comments

Comments
 (0)