diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2017-04-03 09:47:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-03 09:47:16 +0200 |
| commit | e62fbc1c3cad8ce504ccf0538ad9f065d46e223b (patch) | |
| tree | db77a4749b71be5417800a8f126f54487a4fd42e /test | |
| parent | e281a7cda0b7901995705138f10a3748004abff4 (diff) | |
| parent | e7eb21ecca46daaf240e33584c55b9d5101eebc7 (diff) | |
| download | pandoc-e62fbc1c3cad8ce504ccf0538ad9f065d46e223b.tar.gz | |
Merge pull request #3550 from tarleb/lua-readers-submodule
Lua module: add readers submodule
Diffstat (limited to 'test')
| -rw-r--r-- | test/Tests/Lua.hs | 6 | ||||
| -rw-r--r-- | test/lua/markdown-reader.lua | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/Tests/Lua.hs b/test/Tests/Lua.hs index 4f8bd46d8..27a4d8d6f 100644 --- a/test/Tests/Lua.hs +++ b/test/Tests/Lua.hs @@ -26,6 +26,12 @@ tests = "hello-world-doc.lua" (doc . para $ str "Hey!" <> linebreak <> str "What's up?") (doc . para $ str "Hello," <> space <> str "World!") + + , testCase "parse raw markdown blocks" $ + assertFilterConversion "raw markdown block is converted" + "markdown-reader.lua" + (doc $ rawBlock "markdown" "*charly* **delta**") + (doc . para $ emph "charly" <> space <> strong "delta") ] assertFilterConversion :: String -> FilePath -> Pandoc -> Pandoc -> Assertion diff --git a/test/lua/markdown-reader.lua b/test/lua/markdown-reader.lua new file mode 100644 index 000000000..6356113ec --- /dev/null +++ b/test/lua/markdown-reader.lua @@ -0,0 +1,12 @@ +return { + { + RawBlock = function (blk) + local format, content = unpack(blk.c) + if format == "markdown" then + return pandoc.reader.markdown.read_block(content) + else + return blk + end + end, + } +} |
