Good evening,
I'm following the instructions on the developer guide:
http://nginx.org/en/docs/dev/development_guide.html#http_response_body_filters and also this github project:
https://github.com/ngchianglin/NginxHtmlHeadFilter/blob/master/ngx_http_html_head_filter_module.c
What I'm trying to do is to collect all of the tags on an HTML page, then perform an operation on a certain tag group based on tag count? For example: I want to add a class to all <div> tags if there are more <div> tags than <a> tags.
So, (kind of) like the html_head_filter module from above, I want the parser to run on all of the HTML, then do some logic, THEN when it hits the output filter, create a c engine which will modify the requisite tag.
Any help you can provide would be very appreciated.