Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/dok.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsoumith <soumith@fb.com>2015-08-05 14:38:38 +0300
committersoumith <soumith@fb.com>2015-08-05 14:38:38 +0300
commit4b85db042b63ce5af32a92c8e3d11f004930f304 (patch)
treeea38fefea8fbd3561a0781b4834a566862239c38
parente312c3288f76579a883eb6d0d0f09997c6c431ce (diff)
soft-fallback on not loading sundownffifallback
-rw-r--r--init.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/init.lua b/init.lua
index 80ec736..8d235e9 100644
--- a/init.lua
+++ b/init.lua
@@ -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