ngx_http_substitutions_filter_module
ngx_http_substitutions_filter_module copied to clipboard
Remove multiline HTML comments
I'm trying to strip all HTML comments from the output using this regex: (?=<!--)(?:[\s\S]*?-->)
It works fine for single line comments, however for multiline comments it doesn't. For example this one:
<!-- some text
another text -->
I have tried using this expression: (?=<!--)(?:[\s\S\n\r]*?-->)
- didn't work either. Am I missing something?
My directive: subs_filter (?=<!--)(?:[\s\S]*?-->) "" gr;
unfortunately, this module works only per one line
this module check content (lit string or regular exp)one line by one line. so your goal doesn't work