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

swap out beautifulsoup for a string.replace to avoid html reformatting #43

Merged
merged 4 commits into from
Mar 10, 2023
Merged

swap out beautifulsoup for a string.replace to avoid html reformatting #43

merged 4 commits into from
Mar 10, 2023

Conversation

kbehlers
Copy link

see #28 . BeautifulSoup closes tags in unexpected ways during parsing, particularly because of its use of the python built-in 'html.parser'. I encounter similar mangling when using the middleware with certain custom tags.

This removes the dependency on BeautifulSoup to prevent any mangling. It is formatted with Black

django-debug-toolbar does something similar to this merge request, albeit with re.split and str.join instead of the simpler str.replace.

@kbehlers
Copy link
Author

@tjwalch Any chance of this PR getting accepted?

livereload/middleware.py Outdated Show resolved Hide resolved
@kbuilds kbuilds mentioned this pull request Dec 12, 2022
@kbehlers kbehlers requested a review from kbuilds March 9, 2023 22:45
@kbuilds kbuilds merged commit 442e256 into tjwalch:master Mar 10, 2023
@kbehlers kbehlers deleted the remove-beautifulsoup-dependency branch March 10, 2023 16:16
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