[haddock] #89: character references are not recognized in emphasized text

haddock haddock at projects.haskell.org
Mon Feb 16 18:01:40 EST 2009


#89: character references are not recognized in emphasized text
---------------------------------------+------------------------------------
Reporter:  g9ks157k at acme.softbase.org  |        Owner:       
    Type:  defect                      |       Status:  new  
Priority:  major                       |    Milestone:  2.5.0
 Version:  2.4.1                       |   Resolution:       
Keywords:  lexer                       |  
---------------------------------------+------------------------------------
Changes (by SamB):

  * keywords:  => lexer

Comment:

 This appears to be an infelicity in the lexer (GHC's
 {{{compiler/parser/HaddockLex.x}}}):

 {{{
 <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 -> TokEmphasis (init (tail
 s)) }
   [\'\`] $ident+ [\'\`]         { ident }
   \\ .                          { strtoken (TokString . tail) }
   "&#" $digit+ \;               { strtoken $ \s -> TokString [chr (read
 (init (drop 2 s)))] }
   "&#" [xX] $hexdigit+ \;       { strtoken $ \s -> case readHex (init
 (drop 3 s)) of [(n,_)] -> TokString [chr n] }
   -- allow special characters through if they don't fit one of the
 previous
   -- patterns.
   [\/\'\`\<\#\&\\]                      { strtoken TokString }
   [^ $special \/ \< \# \n \'\` \& \\ \]]* \n { strtoken TokString
 `andBegin` line }
   [^ $special \/ \< \# \n \'\` \& \\ \]]+    { strtoken TokString }
 }
 }}}

 Really, I guess the problem is that this is done in the lexer at all -- it
 should probably be done in {{{HaddockParse.y}}} instead.

-- 
Ticket URL: <http://trac.haskell.org/haddock/ticket/89#comment:1>
haddock <http://www.haskell.org/haddock>
Haddock, The Haskell Documentation Tool


More information about the Haddock mailing list