handlers/render.lua

changeset 21
3c71c525cec2
parent 17
bea2ea0b07d9
child 22
8c8e70569d81
--- a/handlers/render.lua	Mon Jul 06 09:36:27 2020 -0500
+++ b/handlers/render.lua	Mon Jul 06 10:56:23 2020 -0500
@@ -11,6 +11,7 @@
 local log=require('log')
 local dependency=require('dependency')
 local pandoc=require('pandoc')
+local markdown_it=require('markdown_it')
 
 --
 -- Phase 1: load & markup
@@ -90,10 +91,12 @@
         local newenv=handlers_render.env_for(file, env, path_prefix)
         local data2=handlers_render.process_lua(data, newenv)
         meta = env.pages[file].meta
-        renderer = meta.renderer or "markdown"
-        if renderer == "pandoc" then
+        renderer = meta.renderer or "markdown-it"
+        if renderer == "markdown-it" then
+            return markdown_it.markdown(data2, env)
+        elseif renderer == "pandoc" then
             return pandoc.pandoc(data2)
-        elseif renderer == "markdown" then
+        elseif renderer == "lua-markdown" then
             return markdown(data2)
         elseif renderer == "none" then
             return data2

mercurial