aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Lua/Module/Utils.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Lua/Module/Utils.hs')
-rw-r--r--src/Text/Pandoc/Lua/Module/Utils.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs
index 01ba4eb46..6fd707bf8 100644
--- a/src/Text/Pandoc/Lua/Module/Utils.hs
+++ b/src/Text/Pandoc/Lua/Module/Utils.hs
@@ -29,8 +29,8 @@ import Text.Pandoc.Definition
import Text.Pandoc.Error (PandocError)
import Text.Pandoc.Lua.Marshaling ()
import Text.Pandoc.Lua.Marshaling.AST
- ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushPandoc
- , peekAttr, peekMeta, peekMetaValue)
+ ( peekBlock, peekInline, peekPandoc, pushBlock, pushInline, pushInlines
+ , pushPandoc, peekAttr, peekMeta, peekMetaValue)
import Text.Pandoc.Lua.Marshaling.ListAttributes (peekListAttributes)
import Text.Pandoc.Lua.Marshaling.List (pushPandocList)
import Text.Pandoc.Lua.Marshaling.SimpleTable
@@ -122,6 +122,14 @@ documentedModule = Module
<#> parameter peekAstElement "AST element" "elem" "some pandoc AST element"
=#> functionResult pushText "string" "stringified element"
+ , defun "text"
+ ### liftPure (B.toList . B.text)
+ <#> parameter peekText "string" "words" "markup-less inlines text"
+ =#> functionResult pushInlines "Inlines" "list of inline elements"
+ #? ("Converts a string to `Inlines`, treating interword spaces as " <>
+ "`Space`s or `SoftBreak`s. If you want a `Str` with literal " <>
+ "spaces, use `pandoc.Str`.")
+
, defun "from_simple_table"
### from_simple_table
<#> parameter peekSimpleTable "SimpleTable" "simple_tbl" ""