0
[CLOSED] Html5 <!DOCTYPE html> Minified form: <!doctypehtml> . Is this valid way.
The html Minifier http://kangax.github.io/html-minifier/ converts the DOCTYPE declaration [<!DOCTYPE html>] to [<!doctypehtml>] Is this also a valid DOCTYPE declaration?
10 ответов
+ 1
Ipang I am talking about the space between the doctype and html keywords.
👇👇👇
<!doctypehtml>
I didn't find any articles regarding this except the article of the Minifier tool.
http://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype
What do you think about this?
+ 1
I got an error when testing in https://validator.w3.org/
Maybe you can test it there also.
+ 1
Yes, it gives error, becuse it is minified code.
Testing a minified HTML code also gives 100s & 1000s of errors, but still there won't be any difference in the webpage with minified and non-minified code.
May be it could be valid use cuz 5M+ devs have used that library in their project and no one have complained about it yet.
+ 1
Perhaps you're right, I've also used http://beautifytools.com/html-minifier.php but it didn't say how many devs had used it. Personally, I prefer uncompressed form for readability. And I also think that removal of one space from the DTD is an overkill for saving just 1 byte while at the same time reduce readability and *possibly*, compatibility.
5M+ devs claim is great moves to boost popularity I guess.
+ 1
That site also among those 5M devs i.e. it also uses the same html-minifier library for minifying given html codes.
Yeah uncompressed code is good for readability and modification. So, I prefer to minify the code only before publishing it to reduce bandwidth usages, faster loading and code plagiarism too..😉
+ 1
Bibek Oli
How do we know which library is used by websites to do its work? e.g. minifying codes?
+ 1
Firstly: almost every online tools for HTML Beautifier, CSS Beautifier, JS Beautifier uses github.com/beautify-web/js-beautify library.
HTML Minifier uses github.com/kangax/html-minifier library(of which this post is about).
JavaScript Minifier/ Uglifier uses github.com/mishoo/UglifyJS library.
CSS Minifier uses github.com/jakubpawlowicz/clean-css library or some 7 line regex to remove comments, spaces, newlines, etc.
etc. etc.
I'm quite familiar with libs as I am also building my own Minifier and Beautifier tools by using these libraries.
Secondly, to know it is by viewing it's source code or downloading the webpage and seeing the linked libraries, but we can get all of these using same libraries except those advanced tools using their own minification/ formatting method in the backend.
+ 1
And yes, https://github.com/kangax/html-minifier/issues/1053 I got the issue there on this topics, I don't see negative reviews on it.
+ 1
Thanks Bibek Oli
Now I understand why you are concerned about compression, as you are working on one of your own 👍
0
"The <!DOCTYPE> declaration is NOT case sensitive."
Quoted from:
https://www.w3schools.com/tags/tag_doctype.asp