Merge pull request 'Fix HTML attribute parsing for escaped quotes' (#3476) from mkljczk/pleroma-fe:attrs-parsing-fix into develop

Reviewed-on: https://git.pleroma.social/pleroma/pleroma-fe/pulls/3476
This commit is contained in:
HJ 2026-03-02 21:18:27 +00:00
commit a9172acd35
2 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix HTML attribute parsing for escaped quotes

View file

@ -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]) => {