wasinger / html-pretty-min Goto Github PK
View Code? Open in Web Editor NEWPHP library for minifying and indenting HTML documents that works on the DOM tree
License: MIT License
PHP library for minifying and indenting HTML documents that works on the DOM tree
License: MIT License
Encountering unexpected error while parsing HTML5 tags:
DOMDocument::loadHTML(): Tag article invalid in Entity, line: 7
D:\...\Pasap\vendor\wa72\html-pretty-min\PrettyMin.php:76
Here is the code I'm trying to minify, https://validator.w3.org says it's valid:
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<article class="News"> <!-- It blocks here -->
<h1 class="title">We are Amazing</h1>
<div class="about">
<em>
By Me,
At 12-12-12 </em>
</div>
<div class="content">
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
Atque, consequatur cum iste laudantium libero magni maxime
minima mollitia quos. At earum nostrum pariatur. Amet, at
fugiat incidunt officia possimus vel?
</p>
</div>
</article>
</body>
</html>
It seems to be a known problem: http://stackoverflow.com/questions/6090667/php-domdocument-errors-warnings-on-html5-tags
If any text node includes Thai characters, the script ends up rewriting them into HTML-escaped characters, but not the right ones.
Input:
<p>โหลด-เกม</p>
Output:
<p>โหลด เกม</p>
I have tried many minifiers, and believe this is the best one to provide css and js minified.
https://github.com/matthiasmullie/minify
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.