[FEATURE] Title attribute without quotes
Feature Request
The following will be invalid HTML, as it is know-able the value will contain a space.
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title={% trans 'Help & Support' %}></i>
Note trans is a synonym for translate, but the same problem can occur for
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title={{ foo }}></i>
This could be expanded to apply to any html attribute. From the spec
The attribute value can remain unquoted if it doesn't contain spaces or any of " ' ` = < or > .
Two other attributes which are likely to contain spaces are value and placeholder, as used with input.
This is quite important because without those quotes, the reformatter can make mistakes.
e.g.
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title={% trans 'Support' %}></i>
becomes
<i class="fa fa-lg fa-question-circle"
data-toggle="tooltip"
title
trans
Support></i>
@jayvdb It took a long time to get to this sorry :) I've made a few updates to the attribute parsing.
Attributes w/out quotes will become quoted. Valid attributes for this are single words, {{ tags }}, {% tags %}, or {% if|for %}{% endif %}.
Hopefully whoever uses an unquoted if/for statement know what they are doing :)
so for your examples,
<!-- in -->
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title={% trans 'Support' %}></I>
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title={{ foo }}></I>
<input checked=checked>
<!-- out -->
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title="{% trans 'Support' %}"></I>
<i class="fa fa-lg fa-question-circle" data-toggle="tooltip" title="{{ foo }}"></I>
<input checked="checked">
Awesome thanks!
:tada: This issue has been resolved in version 1.19.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket: