diff options
author | soumith <soumith@fb.com> | 2015-08-05 14:38:38 +0300 |
---|---|---|
committer | soumith <soumith@fb.com> | 2015-08-05 14:38:38 +0300 |
commit | 4b85db042b63ce5af32a92c8e3d11f004930f304 (patch) | |
tree | ea38fefea8fbd3561a0781b4834a566862239c38 | |
parent | e312c3288f76579a883eb6d0d0f09997c6c431ce (diff) |
soft-fallback on not loading sundownffifallback
-rw-r--r-- | init.lua | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,7 +1,10 @@ -local sd = require 'sundown' - dok = {} require 'dok.inline' -dok.markdown2html = sd.render +local ok,sd = pcall(require, 'sundown') +if ok then + dok.markdown2html = sd.render +else + dok.markdown2html = function() return '<p> Error: Sundown could not be loaded </p>' end +end |