diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-04-15 13:32:28 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-04-15 13:32:28 +0200 |
commit | bcc848d773f9b0f968e7ecb69739adea0432045e (patch) | |
tree | 49c56914ac81c1c0a1fb1a947e90de796d01fcce /src | |
parent | 1fe1c162ac1891fc688e1aef207dd60e18672c06 (diff) |
Avoid parsing "Notes:**" as a bare URI.
This avoids parsing bare URIs that start with a scheme
+ colon + `*`, `_`, or `]`.
Closes #3570.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index a84535875..e985f3d32 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -463,6 +463,8 @@ uri :: Stream [Char] m Char => ParserT [Char] st m (String, String) uri = try $ do scheme <- uriScheme char ':' + -- Avoid parsing e.g. "**Notes:**" as a raw URI: + notFollowedBy (oneOf "*_]") -- We allow sentence punctuation except at the end, since -- we don't want the trailing '.' in 'http://google.com.' We want to allow -- http://en.wikipedia.org/wiki/State_of_emergency_(disambiguation) |