Skip to content

Conversation

@lyndonscotthumphris
Copy link

@lyndonscotthumphris lyndonscotthumphris commented Jan 29, 2026

unsafe html can still be returned from a label for checkboxes.

Issue

In renderers.py for the render method on `FieldRenderer:

if self.field_before_label():
label = self.get_label_html()
field = field + label
label = EMPTY_SAFE_HTML

label is added to field on L486, which if label is not safe, escapes the checkbox field html.

Suggested Fix

The fix i propose is to return the EMPTY_SAFE_HTML if "skip" is chosen.
Otherwise let the render_label method handle it.

Side note: On current code self.show_label can be any value, i.e., "false", which if paired with an empty label "" would still invalidate the html (which is the case for our repo 😅 ).

@scuyangguang
Copy link

scuyangguang commented Jan 29, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants