From afacb1b86fa73c5380c2d0f4b50c3ae0056e2bad Mon Sep 17 00:00:00 2001 From: Simon He <57086651+Simon-He95@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:12:02 +0800 Subject: [PATCH] fix(transformAttrs): attrRules error --- src/transform.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform.ts b/src/transform.ts index 0bb0577..b474403 100644 --- a/src/transform.ts +++ b/src/transform.ts @@ -252,7 +252,7 @@ export function transformAttrs(attrs: any[]) { let newAttr = content for (const match of content.matchAll(attrRules)) { const index = match.index - newAttr = `${newAttr.slice(0, index)}[${match[4].replace(/\s+/g, '')}]${newAttr.slice(index + match[0].length)}` + newAttr = `${newAttr.slice(0, index)}[${match[2].replace(/\s+/g, '')}]${newAttr.slice(index + match[0].length)}` } if (content !== newAttr) {