@@ -308,7 +308,11 @@ blockListToOrg blocks = vcat <$> mapM blockToOrg blocks
308inlineListToOrg :: PandocMonad m
308inlineListToOrg :: PandocMonad m
309 => [Inline]
309 => [Inline]
310 -> Org m Doc
310 -> Org m Doc
311−inlineListToOrg lst = hcat <$> mapM inlineToOrg lst
311+inlineListToOrg lst = hcat <$> mapM inlineToOrg (fixNotes lst)
312+ where fixNotes [] = [] -- prevent note ref from wrapping, see #4171
313+ fixNotes (Space : n@Note{} : rest) =
314+ Str " " : n : fixNotes rest
315+ fixNotes (x : rest) = x : fixNotes rest
313-- | Convert Pandoc inline element to Org.
317-- | Convert Pandoc inline element to Org.
314inlineToOrg :: PandocMonad m => Inline -> Org m Doc
318inlineToOrg :: PandocMonad m => Inline -> Org m Doc