-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
3.1.10, 3.2.0
If you try to use something that contains braces {} in a template file, there is a chance to have it fail without being noticed.
Example: if I wan to use a regex pattern in an input field, I could put something like the following:
pattern="#[0-9a-fA-F]{6}"
This is silently translated into HTML as pattern="#[0-9a-fA-F]6"
I have tried all kinds of variations, and all fail one way or other. I was able to make it work with the following two alternatives:
pattern="#[0-9a-fA-F]{6,6}" // Use a min and max repetition boundary
pattern="#[0-9a-fA-F]{{ '{' }}6{{ '}' }}" // Use Twig escaping for the braces
This is a legitimate use of braces, so I think this should be fixed. The major issue is that it does not give any clue of what is happening or why, so it will be extremely difficult to track as a bug.