forked from elland/haddock2
Haddock 1 doesn't parse nested markup.
This commit is contained in:
parent
c9f61c4e06
commit
4410e67590
1 changed files with 3 additions and 9 deletions
12
src/Lexer.hs
12
src/Lexer.hs
|
|
@ -88,19 +88,13 @@ textElement =
|
|||
|
||||
delimited :: String -> String -> Token -> Token -> Parser [LocatedToken]
|
||||
delimited c1 c2 ot ct = do
|
||||
pos <- getPosition
|
||||
(_, content) <- match $ between op cl any'
|
||||
|
||||
innerToks <- case lexer $ Text.unpack content of
|
||||
Left _ -> do
|
||||
pos' <- getPosition
|
||||
pure $ [(pos', Token content)]
|
||||
Right toks -> pure toks
|
||||
|
||||
pos <- getPosition
|
||||
let openTok :: LocatedToken = (pos, ot)
|
||||
closeTok :: LocatedToken = (pos, ct)
|
||||
res :: LocatedToken = (pos, Token content)
|
||||
|
||||
pure $ openTok : innerToks <> [closeTok]
|
||||
pure [openTok, res, closeTok]
|
||||
where
|
||||
op = string c1
|
||||
cl = string c2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue