aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 296c55f32..60d69638b 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -1126,7 +1126,10 @@ explicitLink = try $ do
skipSpaces
string "`_"
optional $ char '_' -- anonymous form
- return $ B.link (escapeURI $ trim src) "" label'
+ let label'' = if label' == mempty
+ then B.str src
+ else label'
+ return $ B.link (escapeURI $ trim src) "" label''
referenceLink :: RSTParser Inlines
referenceLink = try $ do