@@ -308,7 +308,11 @@ blockListToOrg blocks = vcat <$> mapM blockToOrg blocks
308308inlineListToOrg :: PandocMonad m
309309 => [Inline]
310310 -> 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
312316
313317-- | Convert Pandoc inline element to Org.
314318inlineToOrg :: PandocMonad m => Inline -> Org m Doc