diff options
author | David Waern <david.waern@gmail.com> | 2010-04-08 00:32:52 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2010-04-08 00:32:52 +0000 |
commit | 4afbfaee71fd6529c627325843aaebe3ec7ff938 (patch) | |
tree | 60a9333467dff9cdb300985fd375580e1f6885e9 /src/Haddock/Lex.x | |
parent | 2a45b7c00f64ac30b29a8c0baf2e663a41faab70 (diff) |
Fix #118
Avoid being too greedy when lexing URL markup (<..>), in order to allow
multiple URLs on the same line. Do the same thing with <<..>> and #..#.
Diffstat (limited to 'src/Haddock/Lex.x')
-rw-r--r-- | src/Haddock/Lex.x | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index 115646ca..77d22723 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -82,9 +82,9 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <string,def> { $special { strtoken $ \s -> TokSpecial (head s) } - \<\<.*\>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) } - \<.*\> { strtoken $ \s -> TokURL (init (tail s)) } - \#.*\# { strtoken $ \s -> TokAName (init (tail s)) } + \<\< [^\>]* \>\> { strtoken $ \s -> TokPic (init $ init $ tail $ tail s) } + \< [^\>]* \> { strtoken $ \s -> TokURL (init (tail s)) } + \# [^\#]* \# { strtoken $ \s -> TokAName (init (tail s)) } \/ [^\/]* \/ { strtoken $ \s -> TokEmphasis (init (tail s)) } [\'\`] $ident+ [\'\`] { ident } \\ . { strtoken (TokString . tail) } |