django-htmlmin icon indicating copy to clipboard operation
django-htmlmin copied to clipboard

HTML5 self-closing tags incorrectly become XHTML tags

Open meowgorithm opened this issue 13 years ago • 2 comments

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" />

meowgorithm avatar Sep 21 '12 19:09 meowgorithm

Looks like bs4 still handles it wrongly, even with html5lib. I will take a look later.

fsouza avatar Jan 17 '13 00:01 fsouza

Why not simply use html5lib directly and use it to serialize the tree?

moeffju avatar Nov 26 '13 20:11 moeffju