Markdown: allow attributes in reference links to start on next line.

This addresses a subsidiary issue in #3674.
This commit is contained in:
John MacFarlane 2017-05-18 13:20:32 +02:00
parent 6b8240fc2f
commit 818d5c2f35
2 changed files with 16 additions and 1 deletions

View file

@ -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

View file

@ -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>
```