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

Fix RegEx to unwrap scripts in utils.py #155

Closed
wants to merge 0 commits into from

Conversation

dannyrohde
Copy link
Contributor

Script tag in regular expression needs to be not greedy. Otherwise, it will cut off any scripts that have a ">" in them.

e.g. the line "if (attempts > 100) {" would be cut at the ">" character and the script won't work anymore.

@dannyrohde
Copy link
Contributor Author

Hey, this is my first ever PR, so not sure about the process. Happy to be educated :)

@dannyrohde
Copy link
Contributor Author

See regexr.com/57ggk for an example.

Also, RegExR complains about the unescaped "/" in "</script>". Seems to work without unescaping it, just wanted to let you know.

@dannyrohde dannyrohde changed the title Update utils.py Fix RegEx to unwrap scripts in utils.py Jun 29, 2020
@dannyrohde
Copy link
Contributor Author

Also made a small update on the documentation. Not sure how to separate this into another pull request though.

Copy link
Contributor

@g-k g-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dannyrohde thanks for this PR! Can you add some test cases to test_utils.py or test_templatetags.py for the issue?

@dannyrohde
Copy link
Contributor Author

Create a feature branch on the fork and this closed the pull request. New PR is #161

@g-k g-k mentioned this pull request Jul 27, 2021
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

Successfully merging this pull request may close these issues.

2 participants