#19670: CachedFilesMixin Doesn't Limit Substitutions to Extension Matches
-------------------------------------+--------------------
     Reporter:  matthewwithanm       |      Owner:  nobody
         Type:  Bug                  |     Status:  new
    Component:  contrib.staticfiles  |    Version:  1.4
     Severity:  Normal               |   Keywords:
 Triage Stage:  Unreviewed           |  Has patch:  0
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+--------------------
 The format of the `patterns` attribute seems to imply that substitutions
 will only be performed in files with the corresponding extension. However,
 if a file matches *any* of the filename patterns, then *all* of the listed
 substitutions will be performed. For example:


 {{{
     patterns = (
         ("*.css", (
             r"""(url\(['"]{0,1}\s*(.*?)["']{0,1}\))""",
             r"""(@import\s*["']\s*(.*?)["'])""",
         )),
         ("*.js", (
             r"whatever",
         ),
     )
 }}}

 Not only will `url_converter()` be called for any occurrences of the word
 "whatever" in JavaScript files, but also for any occurrences of
 `url('something')` and `@import('something')` (in JavaScript files).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19670>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to