Skip to content

Commit 448b998

Browse files
committed
skip formatting for old syntax blocks
1 parent 1d20520 commit 448b998

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/remark-format-code.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ export default function remarkFormatCodeBlocks() {
1010
const formattingWork = codeNodes
1111
// skip code blocks with diff meta as they might have
1212
// broken syntax due to + and - characters
13+
// or with `onboardingOptions` as they need to have predictable line numbers
1314
// or `@inject` statements as they often lead to unnecessary line breaks
1415
.filter(
15-
node => !(node.meta?.includes('diff') || node.value?.includes('@inject packages'))
16+
node =>
17+
!(
18+
node.meta?.includes('diff') ||
19+
node.meta?.includes('onboardingOptions') ||
20+
node.value?.includes('@inject packages')
21+
)
1622
)
1723
.map(node => formatCode(node));
1824

0 commit comments

Comments
 (0)