Fix HTML attribute parsing for escaped quotes #480
No reviewers
Labels
No labels
a11y
Bug
Bug fix
cannot reproduce
CSS
Documentation
enhancement
Feature
Feature request
Held for next release cycle
Minor change
performance
priority: critical
priority: high
priority: low
priority: medium
priority: patch welcome
regression
Translation/Locale
WIP
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma-fe!480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mkljczk/akkoma-fe:get-attrs-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I cherry-picked an upstream commit that's merely a workaround for the bug I encountered, but at least keeps akkoma-fe from crashing, and made another commit that slightly improves the regex for this specific case.
The post that breaks our akkomas: https://www.shrimple.pl/2026/02/links2-how-are-things/
Curiously in the
contentfrom the API response the offendinghrefattributes have the embedded quote character HTML escaped likehref="\"$l[1]\""which should just work as is. But apparently something converts this to a regular"character before it reaches this code.It feels like there ought to be a better way to actually properly parse HTML in a web-aligned language like JS/ECMA, but at first glance i only see either an unsafe injection vulnerability footgun or an experimental API with poor browser support :\
Notably however the regex part matcing the key, isn’t correct either. Many more characters are valid in key names: https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
Since this appears to be only used to extract mentions and the likes, I guess this is good enough for now™ to avoid locking up. Thanks!