summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-05-18 13:20:32 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-05-18 13:20:32 +0200
commit818d5c2f354cd4896659493452722c030ae7c766 (patch)
treee3f36b18150bfbb1713a676de83ea1477e4578f8
parent6b8240fc2f45ced4f16403316cab76df15ceaf7a (diff)
Markdown: allow attributes in reference links to start on next line.
This addresses a subsidiary issue in #3674.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs4
-rw-r--r--test/command/3674.md13
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 7434ef1f6..af7588562 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -392,7 +392,9 @@ referenceKey = try $ do
src <- try betweenAngles <|> sourceURL
tit <- option "" referenceTitle
attr <- option nullAttr $ try $
- guardEnabled Ext_link_attributes >> skipSpaces >> attributes
+ do guardEnabled Ext_link_attributes
+ skipSpaces >> optional newline >> skipSpaces
+ attributes
addKvs <- option [] $ guardEnabled Ext_mmd_link_attributes
>> many (try $ spnl >> keyValAttr)
blanklines
diff --git a/test/command/3674.md b/test/command/3674.md
index 09f4e0d1e..92ed4bed7 100644
--- a/test/command/3674.md
+++ b/test/command/3674.md
@@ -24,3 +24,16 @@ Make sure we don't get duplicate reference links, even with
[2]: b
```
+
+Subsidiary issue: allow line break between reference link
+url/title and attributes:
+
+```
+% pandoc
+[a]
+
+[a]: url
+{.class}
+^D
+<p><a href="url" class="class">a</a></p>
+```