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

index 353778d69fa3a434da778682ca69f081f72f1c04..c16ecc861d221bc1fc0f1ed1a7af4676984b1498 100644 (file)
@@ -114,7 +114,11 @@ function nb:ngx_location_tmpl(fheader,ffooter)
          local p1,p2,inc = content:find(ptn)
          if p1 == nil then break end
          inc = self:readall(root .. '/' .. inc)
-         if ishtml then inc = discount(inc) end
+         if ishtml then
+               inc = discount(inc)
+               inc = inc:gsub('^%s*<p>(.*)</p>%s*$','%1')
+               inc = '<div clas="' .. file:match('([^/%.]+)') .. '</div>'
+         end
          content = ''
                .. content:sub(0,p1-1)
                .. inc