-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Labels
Description
I have a file defining some blocks, such as
{-head-}<br>
<h1>....</h1>
<br>
<br>{-head-}
When I use template.render("some.html"), an error occurs:
20xx/xx/xx xx:xx:xx [error] 217324#217324: *10239 open() "/path/to/templates/<br>
<h1>....</h1>
<br>
<br>" failed (2: No such file or directory), other unimportant information.
I spent some time reading code, and identified the issue at
lua-resty-template/lib/resty/template.lua
Line 584 in 2822213
| c[j+2] = '"]=include[=[' |
Deleting it will result in the blocks content not being processed!
I added a functionlocal function plain(v, c) return template.process_string(v, c or context) end at line 413 and replace line 584 withc[j+2] = '"]=plain[=[', and the issue disappeared.
I'm not sure this change is necessary anymore.