]> git.nbdom.net Git - nb.git/commitdiff
lib/lua/nb.lua
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 11 Jun 2018 03:03:00 +0000 (04:03 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 11 Jun 2018 03:03:00 +0000 (04:03 +0100)
lib/lua/nb.lua

index 9db7fa17187e924e56d1c577ba3e6ba23130c5f5..7cc7483dfdd310080eb70fa9c2f93316460d5a0b 100644 (file)
@@ -76,9 +76,9 @@ function nb:ngx_location_tmpl(fheader,ffooter)
        elseif string.match(file,'%.html?$') then
                local i = '<[^>]+>'
                -- Extract title from h1
-               if not vars.title then vars.title = string.match(content,'<h1[^>]*>([^>]+)',1) 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[^>]*>([^>]+)',1) end
+               if not vars.title then vars.title = string.match(content,'<h2[^>]*>([^>]+)</h2>',1) end
 
        elseif not ngx.ctx.tmpl_content then
                ishtml = false