content = self:md2html(content)
-- Extract title from h1
- if not vars.title then vars.title = string.match(content,'^#[\t ]*([^\r\n]+)') end
+ if not vars.title then vars.title = string.match(content,'^#[\t ]*([^\r\n]+)',1) end
-- Extract title from h2
- if not vars.title then vars.title = string.match(content,'##[\t ]*([^\r\n]+)') end
+ if not vars.title then vars.title = string.match(content,'##[\t ]*([^\r\n]+)',1) end
elseif string.match(file,'%.html?$') then
-- Extract title from h1
- if not vars.title then vars.title = string.match(content,'<h1[^>]*>(.*?)</h1>') end
+ if not vars.title then vars.title = string.match(content,'<h1[^>]*>(.*)</h1>',1) end
-- Extract title from h2
- if not vars.title then vars.title = string.match(content,'<h2[^>]*>(.*?)</h2>') end
+ if not vars.title then vars.title = string.match(content,'<h2[^>]*>(.*)</h2>',1) end
elseif not ngx.ctx.tmpl_content then
ishtml = false