Fail to strip HTML comment
-
Does not strip all HTML comments:
https://tppr.me/u4WcY
-
@alriksson thanks for letting me know about this! Internet Explorer conditional comments are not removed, but all the other comments should be removed 100%.
Can you let me know the tool you’ve used to determine there are still comments there? If it’s DOM Monster (https://github.com/madrobby/dom-monster), can you check if it skipped the IE comments?
Correct I use DOM monster 🙂
Hmm seems to be various of comments.
https://ww.wp.xz.cn/plugins/clearfy/
Check here there is more thing we can strip of from the front end.
Another thing I struggle with is to be able to clean the automatically <br> that is output on the frontend. Especially when used ACF. We could disable <p> and <br> but have not found a global or a targeted solution to stirp only the <br>.
It cleans the code and reduces and we keep a cleaner code and less empty nodes in the frontend.
Right now I hack it in the rendered html version with some js.
What do you think?
Hmm seems to be various of comments.
Can you paste here some of the comments? If you have any sensitive information you can strip it.
Another thing I struggle with is to be able to clean the automatically <br> that is output on the frontend. Especially when used ACF. We could disable <p> and <br> but have not found a global or a targeted solution to stirp only the <br>.
It cleans the code and reduces and we keep a cleaner code and less empty nodes in the frontend.
There are various ways (including hooks) to fix this, though I believe it’s not a feature that would fit into Asset CleanUp. It was never requested and formatting ACF content should be done by the ACF (a feature) plugin or one of its extensions.
I think we have to strip all // and <!– comments.
There are various ways (including hooks) to fix this, though I believe it’s not a feature that would fit into Asset CleanUp. It was never requested and formatting ACF content should be done by the ACF (a feature) plugin or one of its extensions.
The valid point just try to find a php solution to do so without success stripping both <p> and <br>
I think we have to strip all // and <!– comments.
@alriksson are you referring to JavaScript’s // comments inside SCRIPT tags? <!— and —> are getting stripped. When you apply minify JavaScript inline tags option in “Settings” -> “Optimize JavaScript”, the minifier will also strip the comments, including the ones starting with /* and ending in */.
The topic ‘Fail to strip HTML comment’ is closed to new replies.