Closed migonzalvar closed 10 months ago
We need to use r"^pattern/(?P<pattern_template_name>[\w./\-\\]+.html)$"
since \w./-\\
is interpreted as word, or .
or range from /
to \
Ah, good catch @migonzalvar! While reviewing this I missed the significance of having the hyphen as the last item in the pattern.
Fixed in #230 and out in version 1.1
Issue Summary
I think I found a regression. After #223, templates with a dash
"-"
in the path are no longer resolved.Steps to Reproduce
patterns/components/quote-block/quote-block.html
http://localhost:8000/pattern-library/
Reverse for 'display_pattern' with arguments '('patterns/components/quote-block/quote-block.html',)' not found. 1 pattern(s) tried: ['\\-/pattern\\-library/pattern/(?P<pattern_template_name>[\\w./-\\\\]+.html)$']
In version 1.0.0 it works just fine.
Technical details
In this snippet, I prove that the previous and current regexp does not behave the same with respect to dashes.
Versions:
PS: Thank you for this awesome library.