Skip to content

HTML escaping issue with Raw HTML copy button for image uploads #2131

@thibaudcolas

Description

@thibaudcolas

In the Image Uploads admin, the "Raw HTML" button should escape the contents of its data-clipboard-content attribute. Otherwise this creates malformed HTML.

Here I think:

source = contentformat.img(obj.image.url, obj.alt_text)
return format_html(
'<button type="button" data-clipboard-content="{}">{}</button>',
source,


Assigning to @vladimir-slavov-iob!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions