allow fallback from discount format to markdown

This commit is contained in:
steve donovan 2011-12-12 15:48:35 +02:00
parent c0d7c6d0ac
commit fb5f5f290c
1 changed files with 9 additions and 1 deletions

View File

@ -150,7 +150,15 @@ function markup.create (ldoc, format)
end
else
local ok,formatter = pcall(require,format)
if not ok then quit("cannot load formatter: "..format) end
if not ok then
if format == 'discount' then
print('format: discount not found, using markdown')
ok,formatter = pcall(require,'markdown')
end
if not ok
quit("cannot load formatter: "..format)
end
end
markup.plain = false
processor = function (txt,item)
if txt == nil then return '' end