git.iko.soy/typeable/pandoc
on master help sign in
Markdown: allow attributes in reference links to start on next line.
818d5c2John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+3−1
@@ -392,7 +392,9 @@ referenceKey = try $ do
392 src <- try betweenAngles <|> sourceURL
392 src <- try betweenAngles <|> sourceURL
393 tit <- option "" referenceTitle
393 tit <- option "" referenceTitle
394 attr <- option nullAttr $ try $
394 attr <- option nullAttr $ try $
395− guardEnabled Ext_link_attributes >> skipSpaces >> attributes
395+ do guardEnabled Ext_link_attributes
396+ skipSpaces >> optional newline >> skipSpaces
397+ attributes
396 addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes
398 addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes
397 >> many (try $ spnl >> keyValAttr)
399 >> many (try $ spnl >> keyValAttr)
398 blanklines
400 blanklines
test/command/3674.md+13
@@ -24,3 +24,16 @@ Make sure we don't get duplicate reference links, even with
24
24
25 [2]: b
25 [2]: b
26```
26```
27+
28+Subsidiary issue: allow line break between reference link
29+url/title and attributes:
30+
31+```
32+% pandoc
33+[a]
34+
35+[a]: url
36+{.class}
37+^D
38+<p><a href="url" class="class">a</a></p>
39+```