You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide whether format_attrs refuses the names c-bind refuses #700
Should format_attrs() refuse the attribute names that c-bind refuses (on*, innerHTML, outerHTML, srcdoc, and names Vue reads as code)?
What happens today
format_attrs (packages/py/citry/citry/attrs.py:834) runs validate_html_attr_name only. The template callers add reject_vue_code_attr_name and reject_script_capable_attr_name, but the public helper does not. Its result is Markup, so Python code that builds a tag with it, such as Markup("<div {}>").format(format_attrs(data)), writes a key such as onclick taken from data as it is.
A template cannot place a value inside a start tag, so only Python code that builds markup is affected.
docs_site/content/advanced/html-attributes.md ("Format as HTML") said the helper "follows the same rules as attributes in a template". The PR for #603 adds a sentence there and in the docstring that the names must come from the app's own code. This issue decides whether the helper should refuse those names instead, which would match c-bind.
Options
Apply reject_script_capable_attr_name (and reject_vue_code_attr_name) in format_attrs. Callers inside Citry that pass names a template wrote (for example <c-element>, static attribute re-formatting on the node path) need a path that skips the check for authored names.
Keep the helper as it is, with the documented rule.
Activity