local template = require "resty.template"
local layout = [[
<div>
{*blocks.title*}
{*view*}
{*blocks.title*}
{*blocks.title*}
</div>]]
local content = [[
{-title-}
<div>I'm title</div>
{-title-}
<h1>hello!</h1>]]
ngx.say(template.new(content, layout):process())
output:
<div>
<h1>hello!</h1>
<div>I'm title</div>
<div>I'm title</div>
</div>
what I expect is:
<div>
<div>I'm title</div>
<h1>hello!</h1>
<div>I'm title</div>
<div>I'm title</div>
</div>
output:
what I expect is: