From c07c9034030e48c4a8b83c652501e5386bc1de8a Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sun, 27 May 2018 04:18:22 +0100 Subject: [PATCH] lib/lua/nb.lua --- lib/lua/nb.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lua/nb.lua b/lib/lua/nb.lua index 5e5fc6d5..2e3ed826 100644 --- a/lib/lua/nb.lua +++ b/lib/lua/nb.lua @@ -67,16 +67,16 @@ function nb:ngx_location_tmpl(fheader,ffooter) 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,']*>(.*?)') end + if not vars.title then vars.title = string.match(content,']*>(.*)',1) end -- Extract title from h2 - if not vars.title then vars.title = string.match(content,']*>(.*?)') end + if not vars.title then vars.title = string.match(content,']*>(.*)',1) end elseif not ngx.ctx.tmpl_content then ishtml = false -- 2.47.3