Ways to customise an HTML post-processing

Hi, there!

My name is Yevhen. I’m in charge of developing the https://settimeout.dev website that is hosted on Netlify. We use a custom UI library that relies on the comments in the HTML for hydration functionality. We noticed that the HTML is modified and all comments are stripped off before it reaches a browser. Is there a way to customize or disable this behaviour? Thanks in advance.

Hey @YevhenKap,

It appears that you’ve resolved the issue.

@hrishikesh, unfortunately, not. I am going to give you an example: the title tag should be enclosed by comments with a pattern: . But it doesn’t. We have a preview (staged) site where comments exist and everything works fine.

Hi @YevhenKap,

Could you try to disable asset optimization from here: Netlify App to see if it changes anything?

Hi @hrishikesh ,

That is strange… I’ve rebuilt the project with the cache cleaning and disabled all asset optimizations. After that, I checked the generated URL and everything seems to work just fine. But the custom domain name still has the problem.

The custom domain is being served by Cloudflare, not Netlify. The source of error lies there. Maybe they’ll be able to help you out.

Hi @hrishikesh
Thanks for the advice! There is an “Auto minify” option for the HTML, JS, and CSS. Disabling the HTML modification fixes the issue.