django-imagekit icon indicating copy to clipboard operation
django-imagekit copied to clipboard

Please allow attribute name with dash using thumbnail template tag

Open hadan opened this issue 10 years ago • 1 comments

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]+)=)?(.+)")

hadan avatar Nov 26 '14 11:11 hadan

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).

matthewwithanm avatar Dec 02 '14 23:12 matthewwithanm