HTMLMinifier will delete <canvas> tags - fix?
See original GitHub issue<canvas>
tag will be erased with HTMLMinifier but it should not! Working e.g. with chart.js needs the <canvas>
tag to draw the chart. Is it possible to fix it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
Missing html closing tag & both body tags. #1020 - GitHub
Dropping empty html, head and body tags is by design since they are nominally redundant, and Google encourages their removal in plain HTML5...
Read more >HTML minifier
Remove tag whitespace Remove space between attributes whenever possible. Note that this will result in invalid HTML! Sort attributes Sort attributes by ...
Read more >HTMLCanvasElement.toDataURL() - Web APIs | MDN
The HTMLCanvasElement.toDataURL() method returns a data URL containing a representation of the image in the format specified by the type ...
Read more >html canvas table
The Canvas tag is basically an IMG tag without any data. ... It's very easy to compose, edit, format and minify the web...
Read more >HTML Paragraphs - W3Schools
The browser will automatically remove any extra spaces and lines when the page ... Use the correct HTML tag to add a paragraph...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well, there is an option enabled in Formatter which removes empty elements:
https://github.com/bitst0rm-pub/Formatter/blob/27dea0804c73b0d2ef43ed6cc25a98ba0399d41e/config/htmlminifierrc.json#L35
"removeEmptyElements": true,
So please report this at https://github.com/bitst0rm-pub/Formatter
Oh you made it! GREAT. With these settings it’s even possible to get Minifyer to keep attributes which contain spaces. Perfect.
"removeEmptyAttributes": false,
thus
will get
<div id=htmllegend></div><canvas id="Macro "></canvas>
that’s exactly what it should. thanx a lot.