is it possible to remove style attributes ?
See original GitHub issuei was hoping to do something like:
minify(HTMLSTRING,{
attrBlackList: ['style']
});
is it possible to achieve the same functionality ?
Issue Analytics
- State:
- Created 9 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Remove Style on Element - javascript - Stack Overflow
//Get the value of style attribute based on element's Id var originalStyle = document.getElementById('sample_id').getAttribute('style'); var ...
Read more >Remove CSS Style Property from an Element using JavaScript
Use the style.removeProperty() method to remove CSS style properties from an element, e.g. box.style.removeProperty('background-color') . The ...
Read more >How to remove style added with .css() function using ...
How to remove style added with .css() function using JavaScript? ; css():It sets or returns one or more style properties for selected elements....
Read more >Remove inline CSS properties from an element with ...
If you want to remove the style attribute of an element completely, you can use JavaScript's removeAttribute() method. JS; CSS; HTML. JS. 1....
Read more >How to remove all style attributes using jQuery? - Tutorialspoint
To remove an attribute from each tag using jQuery, use the removeAttr() method and use the Universal Selector. Let us see how to...
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 FreeTop 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
Top GitHub Comments
This seems like something you’d use a general post-processor for, rather than adding this feature to html-minifier.
After you minify with html-minifier, you can reprocess the output, either with another full-fledged html parser, or with something as simple as
sed
.Looking at src/htmlparser.js it seems that currently HTML is parsed using a combination of linear parser and dynamic regular expressions for matching segments of code.
Another thing @duncanbeevers, I believe removing
data-
,aria-
,ng-
and similar attributes belongs under the basic function of HTML minification.