From 818d5c2f354cd4896659493452722c030ae7c766 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 18 May 2017 13:20:32 +0200 Subject: Markdown: allow attributes in reference links to start on next line. This addresses a subsidiary issue in #3674. --- src/Text/Pandoc/Readers/Markdown.hs | 4 +++- test/command/3674.md | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 +

a

+``` -- cgit v1.2.3