Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail regex error #103

Closed
AlexMili opened this issue Feb 19, 2024 · 2 comments
Closed

Wagtail regex error #103

AlexMili opened this issue Feb 19, 2024 · 2 comments

Comments

@AlexMili
Copy link
Contributor

Platform
MacOS 12.7 with python 3.10.

Describe the bug
The Wagtail DOM regexs [style*='images/'], img[src*='images/'], etc. Are not compiling in python 3.10.

To Reproduce

import re
re.compile("(?:\\.[a-z]+|/media)(?:/[\\w-]+)?/(?:original_images/[\\w-]+|images/[\\w-.]+\\.(?:(?:fill|max|min)-\\d+x\\d+(?:-c\\d+)?|(?:width|height|scale)-\\d+|original))\\.")

Expected behavior
The regex should compile.

Additional context
The source of the bug is [\\w-.]. When modified to [\\w-\\.] everything works accordingly. Before doing a PR fixing this problem, I wanted to be sure I didn't miss something about how Javascript regexs work.

@kingthorin
Copy link
Contributor

kingthorin commented May 9, 2024

The DOM elements aren't regex, they're DOM selectors.

See: #9 and schema.json for more details.

@AlexMili
Copy link
Contributor Author

AlexMili commented May 9, 2024

Arf, you're totally right. After taking that into account I don't have the error anymore. Thks !

@AlexMili AlexMili closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants