Skip to content

Conversation

Providence-o
Copy link

Fixes #2131

format_html marks the url string as a SafeText which prevents it from being escaped when the html is rendered

Copy link
Member

@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Providence-o thank you for giving this a go! This fixes #2131 but reintroduces another issue, which is that alt_text needs to have some escaping done still, at least for double quotes.

Here is what arrives in my clipboard if I use the "Raw HTML" copy button for an image with alt text Green events "tools":

<img src="/m/blog/images/2025/10/green_events_tools.png" alt="Green events "tools"">

This is now invalid HTML since there are double quotes inside alt. Instead, we would want:

<img src="/m/blog/images/2025/10/green_events_tools.png" alt="Green events &quot;tools&quot;">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTML escaping issue with Raw HTML copy button for image uploads
2 participants