From a826d3936dcdefe630715007917dc676eb60861d Mon Sep 17 00:00:00 2001
From: John MacFarlane <fiddlosopher@gmail.com>
Date: Fri, 21 Feb 2014 17:32:02 -0800
Subject: [PATCH] Fixed bug in reference link parsing in markdown_mmd.

The bug was triggered by:

Link to [Google][]. Link to [twitter][].

[Google]: http://google.com
[twitter]: http://twitter.com
---
 src/Text/Pandoc/Readers/Markdown.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 8a41cef49..dd6fa733a 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -354,7 +354,7 @@ referenceKey = try $ do
   tit <- option "" referenceTitle
   -- currently we just ignore MMD-style link/image attributes
   _kvs <- option [] $ guardEnabled Ext_link_attributes
-                      >> many (spnl >> keyValAttr)
+                      >> many (try $ spnl >> keyValAttr)
   blanklines
   let target = (escapeURI $ trimr src,  tit)
   st <- getState