django-htmlmin
django-htmlmin copied to clipboard
HTML5 self-closing tags incorrectly become XHTML tags
I'm finding that, after going through the django-htmlmin middleware implicity self-closing tags (HTML5-style) are becoming explicity self-closed tags (XHTML-style).
For example the <meta> tag here…
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
…incorrectly becomes self-closing after going through the middleware:
<!DOCTYPE html><html><head><meta charset="utf-8" />
Looks like bs4 still handles it wrongly, even with html5lib. I will take a look later.
Why not simply use html5lib directly and use it to serialize the tree?