From 647c4382e84ef6807ccc7c8006fa6e31d657d5e6 Mon Sep 17 00:00:00 2001 From: enpitsulin Date: Wed, 10 Aug 2022 18:01:11 +0800 Subject: [PATCH] fix: remove option work wrong in some language --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index bf327be..83ab6c4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -68,7 +68,7 @@ const rehypePrismDiff: Plugin<[Options?], Element> = ( line.children.forEach((item) => { if (item.type !== 'text') return const itemString = toString(item) - if (itemString.match(/\+|-|!|#/)) fromString(line, itemString.substring(1)) + if (itemString.match(/^\+|-|!|#/)) fromString(item, itemString.substring(1)) }) } }