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 Chintala <soumith@gmail.com>2015-08-05 14:42:50 +0300
committerSoumith Chintala <soumith@gmail.com>2015-08-05 14:42:50 +0300
commite8d58d9e852c729e010cb8b8192f2f7abb0d169a (patch)
treeea38fefea8fbd3561a0781b4834a566862239c38
parente312c3288f76579a883eb6d0d0f09997c6c431ce (diff)
parent4b85db042b63ce5af32a92c8e3d11f004930f304 (diff)
Merge pull request #8 from torch/ffifallback
soft-fallback on not loading sundown
-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