aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2023-09-04 17:26:42 +0000
committertusooa <tusooa@kazv.moe>2023-09-04 17:26:42 +0000
commit1d679b59a07444e18f24167cb7e8563c5e385d9f (patch)
tree0dcb989ae5bb48a53e1b0455a5133bd0256ca28f /src
parentb167025554ec1c1098f17d716e69f8fb0ff795f9 (diff)
parent9baffbfbdeaaf52be95112c519e31ef5f2408180 (diff)
Merge branch 'strip-unbalanced-attributes' into 'develop'
Fix HTML attribute parsing, discard attributes not strating with a letter See merge request pleroma/pleroma-fe!1834
Diffstat (limited to 'src')
-rw-r--r--src/services/html_converter/utility.service.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/services/html_converter/utility.service.js b/src/services/html_converter/utility.service.js
index a1301353..f8e62dfe 100644
--- a/src/services/html_converter/utility.service.js
+++ b/src/services/html_converter/utility.service.js
@@ -22,7 +22,7 @@ export const getAttrs = (tag, filter) => {
.replace(new RegExp('^' + getTagName(tag)), '')
.replace(/\/?$/, '')
.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(([k, v]) => {
if (!v) return [k, true]