Skip to content

Commit 1e12d4f

Browse files
committed
fix: update regex for attribute parsing to improve accuracy
1 parent 4a8f26a commit 1e12d4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/diffDOM/virtual/fromString.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DiffDOMOptionsPartial, nodeType } from "../types"
55
const tagRE =
66
/<\s*\/*[a-zA-Z:_][a-zA-Z0-9:_\-.]*\s*(?:"[^"]*"['"]*|'[^']*'['"]*|[^'"/>])*\/*\s*>|<!--(?:.|\n|\r)*?-->/g
77

8-
const attrRE = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g
8+
const attrRE = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?("[^"]*"|'[^']*')/g
99

1010
function unescape(string: string) {
1111
return string

0 commit comments

Comments
 (0)