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
When the only text inside an attribute is a DTL expression (eg: value='{%if fruit %}{{fruit}}{% endif %}') and after rendering that expression results in an empty string, dojo keeps the DTL expression unmodified inside the attribute. This is troublesome especially for input tags where the value attribute is visible to the user.
Inserting any text inside the attribute so as the resulting attribute is no longer empty after the rendering resolution prevents the problem from happening (eg: value=' {%if fruit %}{{fruit}}{% endif %}', notice the space right after the opening quote).
Problem:
When the only text inside an attribute is a DTL expression (eg:
value='{%if fruit %}{{fruit}}{% endif %}'
) and after rendering that expression results in an empty string, dojo keeps the DTL expression unmodified inside the attribute. This is troublesome especially for input tags where the value attribute is visible to the user.Inserting any text inside the attribute so as the resulting attribute is no longer empty after the rendering resolution prevents the problem from happening (eg:
value=' {%if fruit %}{{fruit}}{% endif %}'
, notice the space right after the opening quote).Example:
index.html
DTLWidget.js
Result:
For the more visually inclined:
Expected:
Expected the input tag to be empty after the rendering process because the variable that the template references does not exist in its context.
The text was updated successfully, but these errors were encountered: