Markdown writer: avoid extra space before citation suffix...

if it already starts with a space.
This commit is contained in:
John MacFarlane 2021-12-14 11:26:28 -08:00
parent d393f2f158
commit be0e3f9794

View file

@ -531,7 +531,9 @@ inlineToMarkdown opts (Cite (c:cs) lst)
sdoc <- inlineListToMarkdown opts sinlines
let k' = literal (modekey m <> "@" <> maybeInBraces k)
r = case sinlines of
Str (T.uncons -> Just (y,_)):_ | y `elem` (",;]@" :: String) -> k' <> sdoc
Str (T.uncons -> Just (y,_)):_
| y `elem` (",;]@" :: String) -> k' <> sdoc
Space:_ -> k' <> sdoc
_ -> k' <+> sdoc
return $ pdoc <+> r
modekey SuppressAuthor = "-"