Fix HTML attribute parsing for escaped quotes
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
parent
2ce11e56d4
commit
208600bd16
2 changed files with 2 additions and 1 deletions
1
changelog.d/attrs-parsing.fix
Normal file
1
changelog.d/attrs-parsing.fix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fix HTML attribute parsing for escaped quotes
|
||||
|
|
@ -23,7 +23,7 @@ export const getAttrs = (tag, filter) => {
|
|||
.replace(/\/?$/, '')
|
||||
.trim()
|
||||
const attrs = Array.from(
|
||||
innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi),
|
||||
innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=((?:"(?:\\.|[^"\\])*")|(?:'(?:\\.|[^'\\])*')))?/gi),
|
||||
)
|
||||
.map(([, key, value]) => [key, value])
|
||||
.map(([k, v]) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue