From d75fa7a991a24e2c4fc3fbd66525acb02055727a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Marussy?= Date: Fri, 26 Apr 2024 19:41:51 +0200 Subject: [PATCH] fix(docs): non-linear time regex --- subprojects/docs/src/plugins/remarkPosix2Windows.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/docs/src/plugins/remarkPosix2Windows.ts b/subprojects/docs/src/plugins/remarkPosix2Windows.ts index 66baca30..784802f2 100644 --- a/subprojects/docs/src/plugins/remarkPosix2Windows.ts +++ b/subprojects/docs/src/plugins/remarkPosix2Windows.ts @@ -68,7 +68,10 @@ function createTabItem( function transformNode(node: Code): MdxJsxFlowElement[] { const posixCode = node.value; - const windowsCode = posixCode.replaceAll(/(?<=^\w*)\.\//gm, '.\\'); + const windowsCode = posixCode.replaceAll( + /(^\w*)\.\//gm, + (_substring, prefix: string) => `${prefix}.\\`, + ); return [ { type: 'mdxJsxFlowElement',