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 "re.error: bad escape \u" #1177

Merged
merged 1 commit into from Dec 30, 2023
Merged

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Dec 22, 2023

We were using re.sub() to inject the tooldrawer HTML. Re.sub treats backslashes in the replacement string specially. When the injected HTML includes a backslash (e.g. in JSON string data), this results in a "bad escape \u" exception.

Description of Changes

  • Added unit test(s) covering the changes (if testable)

We were using re.sub() to inject the tooldrawer HTML.  Re.sub treats
backslashes in the replacement string specially.  When the injected
HTML includes a backslash (e.g. in JSON string data), this was
resulting in a "bad escape \u" exception.
@yagebu yagebu merged commit 00ff6b4 into lektor:master Dec 30, 2023
15 checks passed
@dairiki dairiki deleted the fix.inject-tooldrawer branch January 7, 2024 22:09
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.

None yet

2 participants