From 0a04c69dbba991a5376c55defdc6ac3fe915c28c Mon Sep 17 00:00:00 2001 From: Jonathan Neal Date: Thu, 12 Aug 2021 12:51:37 -0400 Subject: Fix left curly bracket formatting (#1094) * Fix curly braces * Add tests * chore: formatting * sstyle: update fix to be more explicit and ireduce chance of false positive * style: use suggestions Co-authored-by: mmarkelov --- packages/markdown-support/src/codeblock.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/markdown-support/src') diff --git a/packages/markdown-support/src/codeblock.ts b/packages/markdown-support/src/codeblock.ts index 2f48c6631..3f3e8237c 100644 --- a/packages/markdown-support/src/codeblock.ts +++ b/packages/markdown-support/src/codeblock.ts @@ -21,7 +21,7 @@ export function rehypeCodeBlock() { const escapeCode = (code: any) => { code.children = code.children.map((child: any) => { if (child.type === 'text') { - return { ...child, value: child.value.replace(/\{/g, '{') }; + return { ...child, value: child.value.replace(/\{/g, 'ASTRO_ESCAPED_LEFT_CURLY_BRACKET\0') }; } return child; }); -- cgit v1.2.3