diff options
author | Yan Pas <yanp.bugz@gmail.com> | 2018-10-07 18:10:01 +0300 |
---|---|---|
committer | Yan Pas <yanp.bugz@gmail.com> | 2018-10-07 18:10:01 +0300 |
commit | 27467189ab184c5d098e244e01f7d1bfdb0d4d45 (patch) | |
tree | d1fb96ebbc49ee0c4e73ef354feddd521690d545 /test/lua | |
parent | 4f3dd3b1af7217214287ab886147c5e33a54774d (diff) | |
parent | bd8a66394bc25b52dca9ffd963a560a4ca492f9c (diff) | |
download | pandoc-27467189ab184c5d098e244e01f7d1bfdb0d4d45.tar.gz |
Merge branch 'master' into groff_reader
Diffstat (limited to 'test/lua')
-rw-r--r-- | test/lua/test-pandoc-utils.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lua/test-pandoc-utils.lua b/test/lua/test-pandoc-utils.lua index 21f937edb..4421603ec 100644 --- a/test/lua/test-pandoc-utils.lua +++ b/test/lua/test-pandoc-utils.lua @@ -1,5 +1,19 @@ utils = require 'pandoc.utils' +-- Squash blocks to inlines +------------------------------------------------------------------------ +function test_blocks_to_inlines () + local blocks = { + pandoc.Para{ pandoc.Str 'Paragraph1' }, + pandoc.Para{ pandoc.Emph 'Paragraph2' } + } + local inlines = utils.blocks_to_inlines(blocks, {pandoc.LineBreak()}) + return #inlines == 3 + and inlines[1].text == "Paragraph1" + and inlines[2].t == 'LineBreak' + and inlines[3].content[1].text == "Paragraph2" +end + -- hierarchicalize ------------------------------------------------------------------------ function test_hierarchicalize () @@ -110,6 +124,7 @@ end function Para (el) return { + pandoc.Plain{pandoc.Str("blocks_to_inlines: " .. run(test_blocks_to_inlines))}, pandoc.Plain{pandoc.Str("hierarchicalize: " .. run(test_hierarchicalize))}, pandoc.Plain{pandoc.Str("normalize_date: " .. run(test_normalize_date))}, pandoc.Plain{pandoc.Str("pipe: " .. run(test_pipe))}, |