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