From c0cc9270cbfad719d4cd3b8c57060cb06d41fe78 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 18 Dec 2017 16:31:32 -0800 Subject: Org writer: don't allow fn refs to wrap to beginning of line. Otherwise they can be interpreted as footnote definitions. Closes #4171. --- src/Text/Pandoc/Writers/Org.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index f73822b86..b2f9bbc53 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -308,7 +308,11 @@ blockListToOrg blocks = vcat <$> mapM blockToOrg blocks inlineListToOrg :: PandocMonad m => [Inline] -> Org m Doc -inlineListToOrg lst = hcat <$> mapM inlineToOrg lst +inlineListToOrg lst = hcat <$> mapM inlineToOrg (fixNotes lst) + where fixNotes [] = [] -- prevent note ref from wrapping, see #4171 + fixNotes (Space : n@Note{} : rest) = + Str " " : n : fixNotes rest + fixNotes (x : rest) = x : fixNotes rest -- | Convert Pandoc inline element to Org. inlineToOrg :: PandocMonad m => Inline -> Org m Doc -- cgit v1.2.3