@@ -308,6 +308,12 @@ escapeString s =
308308 substitute "</verbatim>" "<</verbatim><verbatim>/verbatim>" s ++
309309 "</verbatim>"
310310
311+-- | Replace newlines with spaces
312+replaceNewlines :: String -> String
313+replaceNewlines ('\n':xs) = ' ':replaceNewlines xs
314+replaceNewlines (x:xs) = x:replaceNewlines xs
315+replaceNewlines [] = []
316+
311317startsWithMarker :: (Char -> Bool) -> String -> Bool
312318startsWithMarker f (' ':xs) = startsWithMarker f xs
313319startsWithMarker f (x:xs) =
@@ -517,7 +523,7 @@ inlineToMuse :: PandocMonad m
517523 => Inline
518524 -> Muse m Doc
519525inlineToMuse (Str str) = do
520− escapedStr <- conditionalEscapeString str
526+ escapedStr <- conditionalEscapeString $ replaceNewlines str
521527 let useTags = isAlphaNum $ last escapedStr -- escapedStr is never empty because empty strings are escaped
522528 modify $ \st -> st { stUseTags = useTags }
523529 return $ text escapedStr