-
- Downloads
Remove HtmlPrettifyMiddleware (used in development mode)
HtmlPrettifyMiddleware uses the `prettify()` method from BeautifulSoup. Its documentation says: > Since it adds whitespace (in the form of newlines), `prettify()` changes > the meaning of an HTML document and should not be used to reformat one. > The goal of `prettify()` is to help you visually understand the structure > of the documents you work with. Having HtmlPrettifyMiddleware enabled therefore leads to surprising behavior, like extra spaces surrounding “something” when writing `<code>something</code>` in a template. Now that Django templates are prettified using `djlint`, this middleware only has downsides. Let’s remove it entirely.
Please register or sign in to comment