Avoid parsing "Notes:**" as a bare URI.
This avoids parsing bare URIs that start with a scheme
+ colon + `*`, `_`, or `]`.
Closes #3570.
commitbcc848d773f9b0f968e7ecb69739adea0432045e
authorJohn MacFarlane <jgm@berkeley.edu>
dateSat 15 Apr 2017, 13:32 (10 years ago)
parent1fe1c16
src/Text/Pandoc/Parsing.hs+2
@@ -463,6 +463,8 @@ uri :: Stream [Char] m Char => ParserT [Char] st m (String, String)
463463uri = try $ do
464464 scheme <- uriScheme
465465 char ':'
466+ -- Avoid parsing e.g. "**Notes:**" as a raw URI:
467+ notFollowedBy (oneOf "*_]")
466468 -- We allow sentence punctuation except at the end, since
467469 -- we don't want the trailing '.' in 'http://google.com.' We want to allow
468470 -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation)
test/command/3570.mdnew file+6
@@ -0,0 +1,6 @@
1+```
2+% pandoc -f markdown+autolink_bare_uris
3+**Notes:**
4+^D
5+<p><strong>Notes:</strong></p>
6+```