if string.match(file,'%.md$') then
-- Markdown
discount = require("discount")
- ngx.print(discount(content))
+ content = discount(content)
+ local tags = { 'th', 'td' }
+ -- for tag in self:values(tags) do
+ -- content = content:gsub(" +(</th>)","%1")
+ -- end
+ content = content:gsub(" +(</th>)","%1")
+ content = content:gsub("(<th>) +","%1")
+ content = content:gsub(" +(</td>)","%1")
+ content = content:gsub("(<td>) +","%1")
+ ngx.print(content)
elseif string.match(file,'%.html$') then
-- Html
ngx.exit(0)
end
+function values(t)
+ local i = 0
+ return function() i = i + 1; return t[i] end
+end
-- function nb:ngx_vars()
-- local vars = {}
-- vars = {