markdown does not like being passed nil ;(

This commit is contained in:
steve donovan 2011-04-28 13:59:51 +02:00
parent 9541e0274c
commit 3c99418905
1 changed files with 1 additions and 0 deletions

View File

@ -543,6 +543,7 @@ if args.format ~= 'plain' then
local ok,markup = pcall(require,args.format) local ok,markup = pcall(require,args.format)
if not ok then quit("cannot load formatter: "..args.format) end if not ok then quit("cannot load formatter: "..args.format) end
function ldoc.markup(txt) function ldoc.markup(txt)
if txt == nil then return '' end
txt = markup(txt) txt = markup(txt)
return (txt:gsub('^%s*<p>(.+)</p>%s*$','%1')) return (txt:gsub('^%s*<p>(.+)</p>%s*$','%1'))
end end