I have an HTML page with the following opening body tag:
<body class="one two three" id="five" data-key="value">
And I'm using lua patterns append a div to the end:
<body class="one two three" id="five" data-key="value"><div></div>
How do I do this?
Note: I've used the following before to insert a script before the head tag:
body_filter_by_lua_block {
replacestr = "<script></script></head>"
ngx.arg[1] = ngx.re.sub(ngx.arg[1],"</head>", replacestr)
return
}
Therefore, if I add my div to replacestr
, what do I replace ngx.re.sub(ngx.arg[1],"</head>", replacestr)
with?