From 14584bbbd3e42e468f8b1d5e75dde8df0edc126e Mon Sep 17 00:00:00 2001 From: Ivan Hofer Date: Sun, 7 Aug 2022 20:29:00 +0200 Subject: [PATCH] fix naming of `regex_quoted_value` --- src/compiler/preprocess/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/preprocess/index.ts b/src/compiler/preprocess/index.ts index 46ebc83181..34fb2027d2 100644 --- a/src/compiler/preprocess/index.ts +++ b/src/compiler/preprocess/index.ts @@ -123,7 +123,7 @@ function processed_tag_to_code( } const regex_whitespace = /\s+/; -const regex_unquoted_value = /^['"](.*)['"]$/; +const regex_quoted_value = /^['"](.*)['"]$/; function parse_tag_attributes(str: string) { // note: won't work with attribute values containing spaces. @@ -133,7 +133,7 @@ function parse_tag_attributes(str: string) { .reduce((attrs, attr) => { const i = attr.indexOf('='); const [key, value] = i > 0 ? [attr.slice(0, i), attr.slice(i + 1)] : [attr]; - const [, unquoted] = (value && value.match(regex_unquoted_value)) || []; + const [, unquoted] = (value && value.match(regex_quoted_value)) || []; return { ...attrs, [key]: unquoted ?? value ?? true }; }, {});