#21080: collectstatic post-processing fails for references inside comments -------------------------------------+------------------------------------ Reporter: shreyas@… | Owner: nobody Type: Bug | Status: new Component: contrib.staticfiles | Version: 1.5 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------ Changes (by marfire):
* needs_better_patch: => 0 * stage: Unreviewed => Accepted * needs_tests: => 0 * needs_docs: => 0 Comment: `CachedFilesMixin` is using simple [https://github.com/django/django/blob/6a6428a36f221446b17eaf4876e92d3db1781962/django/contrib/staticfiles/storage.py#L49 regular expressions] to match `url` and `@import` statements, and so is picking up the ones inside comments. It would also have a problem if the text was inside a string. If it's possible to rewrite the regex to cover all the corner cases, that would be the easy fix. But I doubt it. The robust way would be to parse the css files properly, but that would mean rewriting a lot of code... -- Ticket URL: <https://code.djangoproject.com/ticket/21080#comment:1> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/075.80631c3e1b8199555a16525db52f8ff8%40djangoproject.com. For more options, visit https://groups.google.com/groups/opt_out.