mirror of
https://github.com/django-components/django-components.git
synced 2025-07-14 04:14:58 +00:00
Add support for - and / in component names in middleware
- Fix the COMPONENT_COMMENT_REGEX to find component names with special symbols.
- Fix the test to catch the error.
Follow-up of e0c29e5
and ref: #262
This commit is contained in:
parent
c0fc6c0a12
commit
a919b648b3
2 changed files with 20 additions and 17 deletions
|
@ -11,9 +11,9 @@ CSS_DEPENDENCY_PLACEHOLDER = '<link name="CSS_PLACEHOLDER">'
|
|||
JS_DEPENDENCY_PLACEHOLDER = '<script name="JS_PLACEHOLDER"></script>'
|
||||
|
||||
SCRIPT_TAG_REGEX = re.compile("<script")
|
||||
COMPONENT_COMMENT_REGEX = re.compile(rb"<!-- _RENDERED (?P<name>\w+?) -->")
|
||||
COMPONENT_COMMENT_REGEX = re.compile(rb"<!-- _RENDERED (?P<name>[\w\-/]+?) -->")
|
||||
PLACEHOLDER_REGEX = re.compile(
|
||||
rb"<!-- _RENDERED (?P<name>[\w\-\/]+?) -->"
|
||||
rb"<!-- _RENDERED (?P<name>[\w\-/]+?) -->"
|
||||
rb'|<link name="CSS_PLACEHOLDER">'
|
||||
rb'|<script name="JS_PLACEHOLDER"></script>'
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue