From 013351f6023a6b8b83e9f8c45d8a8fbc6dcd46f1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 25 Apr 2023 14:33:19 +0200 Subject: Writers.OpenDocument: fix invalid text:p inside text:p from meta The only element in meta for which data/templates/default.opendocument allows block element content appears to be "abstract", which is already filtered out of meta' at this point, so simply convert all blocks to linebreak-separated inlines. Fixes: #8256 --- src/Text/Pandoc/Writers/OpenDocument.hs | 2 +- test/command/8256.md | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 test/command/8256.md diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs index 1c8417c47..e844d91f7 100644 --- a/src/Text/Pandoc/Writers/OpenDocument.hs +++ b/src/Text/Pandoc/Writers/OpenDocument.hs @@ -255,7 +255,7 @@ writeOpenDocument opts (Pandoc meta blocks) = do collectBlockIdent _ = [] modify $ \s -> s{ stIdentTypes = query collectBlockIdent blocks } m <- metaToContext opts - (blocksToOpenDocument opts) + (inlinesToOpenDocument opts . blocksToInlines) (fmap chomp . inlinesToOpenDocument opts) meta' b <- blocksToOpenDocument opts blocks diff --git a/test/command/8256.md b/test/command/8256.md new file mode 100644 index 000000000..76398f607 --- /dev/null +++ b/test/command/8256.md @@ -0,0 +1,34 @@ +``` +% pandoc -t opendocument -s + +--- +title: | + This *is* \ + a test +author: Someone +--- + +Testing. +^D + + + + + + + + + + + + +This +isa +test +Someone +Testing. + + + +``` + -- cgit v1.2.3