mirror of
https://git.pleroma.social/sjw/pleroma-fe.git
synced 2025-01-03 10:35:15 +01:00
Merge remote-tracking branch 'upstream/develop' into neckbeard
This commit is contained in:
commit
0d749f4e1e
1
changelog.d/html-attribute-parsing.fix
Normal file
1
changelog.d/html-attribute-parsing.fix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix HTML attribute parsing, discard attributes not strating with a letter
|
@ -22,7 +22,7 @@ export const getAttrs = (tag, filter) => {
|
|||||||
.replace(new RegExp('^' + getTagName(tag)), '')
|
.replace(new RegExp('^' + getTagName(tag)), '')
|
||||||
.replace(/\/?$/, '')
|
.replace(/\/?$/, '')
|
||||||
.trim()
|
.trim()
|
||||||
const attrs = Array.from(innertag.matchAll(/([a-z0-9-]+)(?:=("[^"]+?"|'[^']+?'))?/gi))
|
const attrs = Array.from(innertag.matchAll(/([a-z]+[a-z0-9-]*)(?:=("[^"]+?"|'[^']+?'))?/gi))
|
||||||
.map(([trash, key, value]) => [key, value])
|
.map(([trash, key, value]) => [key, value])
|
||||||
.map(([k, v]) => {
|
.map(([k, v]) => {
|
||||||
if (!v) return [k, true]
|
if (!v) return [k, true]
|
||||||
|
Loading…
Reference in New Issue
Block a user