git.iko.soy/typeable/pandoc
on master help sign in
Markdown: allow attributes in reference links to start on next line.

This addresses a subsidiary issue in #3674.

commit818d5c2f354cd4896659493452722c030ae7c766 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 18 May 2017, 13:20 (9 years ago) parent6b8240f
2 files changed+16−1
src/Text/Pandoc/Readers/Markdown.hs+3−1 test/command/3674.md+13
src/Text/Pandoc/Readers/Markdown.hs+3−1
@@ -392,7 +392,9 @@ referenceKey = try $ do
392392 src <- try betweenAngles <|> sourceURL
393393 tit <- option "" referenceTitle
394394 attr <- option nullAttr $ try $
395− guardEnabled Ext_link_attributes >> skipSpaces >> attributes
395+ do guardEnabled Ext_link_attributes
396+ skipSpaces >> optional newline >> skipSpaces
397+ attributes
396398 addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes
397399 >> many (try $ spnl >> keyValAttr)
398400 blanklines
test/command/3674.md+13
@@ -24,3 +24,16 @@ Make sure we don't get duplicate reference links, even with
2424
2525 [2]: b
2626```
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+```