aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-12-20 13:03:13 +0100
committerJohn MacFarlane <[email protected]>2022-12-20 13:39:16 -0800
commit1328e57f088d9f4dab230cd608c5945c605efb3c (patch)
treed4974bac1cbcf8d243098916eb946af1d15eae8c
parentc954dfab59fd1d93a838e4023c9f365280e63b30 (diff)
Shared: use LineBreak as default block sep in blocksToInlines
This change also affects the `pandoc.utils.blocks_to_inlines` Lua function. Closes: #8499
-rw-r--r--doc/lua-filters.md3
-rw-r--r--pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs2
-rw-r--r--pandoc-lua-engine/test/lua/module/pandoc-utils.lua3
-rw-r--r--src/Text/Pandoc/Shared.hs2
-rw-r--r--test/command/yaml-with-chomp.md6
-rw-r--r--test/docx/comments.native2
-rw-r--r--test/docx/golden/comments.docxbin10177 -> 10175 bytes
7 files changed, 11 insertions, 7 deletions
diff --git a/doc/lua-filters.md b/doc/lua-filters.md
index 762c893f8..2a9787f4f 100644
--- a/doc/lua-filters.md
+++ b/doc/lua-filters.md
@@ -3650,8 +3650,7 @@ Parameters:
`sep`
: List of [Inline](#type-inline) elements inserted as separator
between two consecutive blocks; defaults to
- `{pandoc.Str'\u{2029}'}`, i.e., to the PARAGRAPH SEPARATOR
- Unicode character.
+ `{pandoc.LineBreak()}`.
Returns:
diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs
index 16305b76e..96d991de5 100644
--- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs
+++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Module/Utils.hs
@@ -56,7 +56,7 @@ documentedModule = Module
return $ B.toList (Shared.blocksToInlinesWithSep sep blks))
<#> parameter (peekList peekBlock) "list of blocks"
"blocks" ""
- <#> opt (parameter (peekList peekInline) "list of inlines" "inline" "")
+ <#> opt (parameter (peekList peekInline) "Inlines" "sep" "")
=#> functionResult pushInlines "list of inlines" ""
, defun "citeproc"
diff --git a/pandoc-lua-engine/test/lua/module/pandoc-utils.lua b/pandoc-lua-engine/test/lua/module/pandoc-utils.lua
index c2e1c4140..a31250bfe 100644
--- a/pandoc-lua-engine/test/lua/module/pandoc-utils.lua
+++ b/pandoc-lua-engine/test/lua/module/pandoc-utils.lua
@@ -13,7 +13,8 @@ return {
pandoc.Para { pandoc.Emph { pandoc.Str 'Paragraph2' } }
}
local expected = {
- pandoc.Str 'Paragraph1\u{2029}',
+ pandoc.Str 'Paragraph1',
+ pandoc.LineBreak(),
pandoc.Emph { pandoc.Str 'Paragraph2' }
}
assert.are_same(
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 624696c1e..c0ba38966 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -847,7 +847,7 @@ defaultBlocksSeparator :: Inlines
defaultBlocksSeparator =
-- This is used in the pandoc.utils.blocks_to_inlines function. Docs
-- there should be updated if this is changed.
- B.str "\8233" -- PARAGRAPH SEPARATOR
+ B.linebreak
--
-- Safe read
diff --git a/test/command/yaml-with-chomp.md b/test/command/yaml-with-chomp.md
index d86c30ba2..6dc75fc83 100644
--- a/test/command/yaml-with-chomp.md
+++ b/test/command/yaml-with-chomp.md
@@ -10,7 +10,11 @@ ml: |-
Pandoc
Meta
{ unMeta =
- fromList [ ( "ml" , MetaInlines [ Str "TEST\8233BLOCK" ] ) ]
+ fromList
+ [ ( "ml"
+ , MetaInlines [ Str "TEST" , LineBreak , Str "BLOCK" ]
+ )
+ ]
}
[]
```
diff --git a/test/docx/comments.native b/test/docx/comments.native
index 6e1aafe0d..9b382518d 100644
--- a/test/docx/comments.native
+++ b/test/docx/comments.native
@@ -1,4 +1,4 @@
[Para [Str "I",Space,Str "want",Space,Span ("",["comment-start"],[("id","0"),("author","Jesse Rosenthal"),("date","2016-05-09T16:13:00Z")]) [Str "I",Space,Str "left",Space,Str "a",Space,Str "comment."],Str "some",Space,Str "text",Space,Str "to",Space,Str "have",Space,Str "a",Space,Str "comment",Space,Span ("",["comment-end"],[("id","0")]) [],Str "on",Space,Str "it."]
,Para [Str "This",Space,Str "is",Space,Span ("",["comment-start"],[("id","1"),("author","Jesse Rosenthal"),("date","2016-05-09T16:13:00Z")]) [Str "A",Space,Str "comment",Space,Str "across",Space,Str "paragraphs."],Str "a",Space,Str "new",Space,Str "paragraph."]
,Para [Str "And",Space,Str "so",Span ("",["comment-end"],[("id","1")]) [],Space,Str "is",Space,Str "this."]
-,Para [Str "One",Space,Span ("",["comment-start"],[("id","2"),("author","Jesse Rosenthal"),("date","2016-05-09T16:14:00Z")]) [Str "This",Space,Str "one",Space,Str "has",Space,Str "multiple",Space,Str "paragraphs.\8233See?"],Str "more",Span ("",["comment-end"],[("id","2")]) [],Str ".",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "one",Space,Str "with",Space,Str "a",Space,Span ("",["comment-start"],[("id","3"),("author","Jesse Rosenthal"),("date","2016-06-22T14:35:00Z")]) [Str "Do",Space,Str "something."],Span ("",["comment-start"],[("id","4"),("author","Jesse Rosenthal"),("date","2016-06-22T14:36:00Z")]) [Str "Do",Space,Str "something",Space,Str "else."],Str "comment",Space,Str "in",Space,Str "a",Space,Str "comment",Span ("",["comment-end"],[("id","3")]) [Span ("",["comment-end"],[("id","4")]) []],Str "."]]
+,Para [Str "One",Space,Span ("",["comment-start"],[("id","2"),("author","Jesse Rosenthal"),("date","2016-05-09T16:14:00Z")]) [Str "This",Space,Str "one",Space,Str "has",Space,Str "multiple",Space,Str "paragraphs.",LineBreak, Str "See?"],Str "more",Span ("",["comment-end"],[("id","2")]) [],Str ".",Space,Str "And",Space,Str "this",Space,Str "is",Space,Str "one",Space,Str "with",Space,Str "a",Space,Span ("",["comment-start"],[("id","3"),("author","Jesse Rosenthal"),("date","2016-06-22T14:35:00Z")]) [Str "Do",Space,Str "something."],Span ("",["comment-start"],[("id","4"),("author","Jesse Rosenthal"),("date","2016-06-22T14:36:00Z")]) [Str "Do",Space,Str "something",Space,Str "else."],Str "comment",Space,Str "in",Space,Str "a",Space,Str "comment",Span ("",["comment-end"],[("id","3")]) [Span ("",["comment-end"],[("id","4")]) []],Str "."]]
diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx
index 028cf10fa..158ffc2bf 100644
--- a/test/docx/golden/comments.docx
+++ b/test/docx/golden/comments.docx
Binary files differ