Markdown Writer: put space before reference link definitions

Fixes #3630 (#3631).

Previously the attributes in link reference definitions did not have a space preceding.
This commit is contained in:
Mauro Bieg 2017-05-03 12:13:25 +02:00 committed by John MacFarlane
parent cd2551c16c
commit e02cfcdeac
2 changed files with 9 additions and 1 deletions

View file

@ -241,7 +241,7 @@ keyToMarkdown opts (label', (src, tit), attr) = do
else space <> "\"" <> text tit <> "\"" else space <> "\"" <> text tit <> "\""
return $ nest 2 $ hang 2 return $ nest 2 $ hang 2
("[" <> label' <> "]:" <> space) (text src <> tit') ("[" <> label' <> "]:" <> space) (text src <> tit')
<> linkAttributes opts attr <+> linkAttributes opts attr
-- | Return markdown representation of notes. -- | Return markdown representation of notes.
notesToMarkdown :: PandocMonad m => WriterOptions -> [[Block]] -> MD m Doc notesToMarkdown :: PandocMonad m => WriterOptions -> [[Block]] -> MD m Doc

8
test/command/3630.md Normal file
View file

@ -0,0 +1,8 @@
```
% pandoc -f markdown -t markdown --reference-links
![foo](bar.png){#myId}
^D
![foo]
[foo]: bar.png {#myId}
```