From 4afbfaee71fd6529c627325843aaebe3ec7ff938 Mon Sep 17 00:00:00 2001 From: David Waern Date: Thu, 8 Apr 2010 00:32:52 +0000 Subject: 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 #..#. --- src/Haddock/Lex.x | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Haddock/Lex.x') 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 \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] { $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) } -- cgit v1.2.3