django-imagekit
django-imagekit copied to clipboard
Please allow attribute name with dash using thumbnail template tag
Hi, hope you can allow attribute name with dash in thumbnail template tag . This will be more compatible with html 5 spec that allow attribute like data-id , etc.
I suggest a fix in imagekit/templatetags/compat.py:
kwarg_re = re.compile(r"(?:([-\w]+)=)?(.+)")
Hi @hadan! This issue was actually already raised in #252 and #253. You can check out my comments there but, in short: the "compat" module is just meant to be a compatibility layer for old versions of Django. Django doesn't support dashes in template tags, so we don't either.
However, since this has come up before, I guess we could do it, if you want to put together a PR. It will have to be well documented, though, and move the function out of the "compat" module (since it'll no longer be there for compatibility reasons).