diff options
-rw-r--r-- | bbcode/src/Text/BBCode/Lexer.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bbcode/src/Text/BBCode/Lexer.hs b/bbcode/src/Text/BBCode/Lexer.hs index 7171a0e..03f57d2 100644 --- a/bbcode/src/Text/BBCode/Lexer.hs +++ b/bbcode/src/Text/BBCode/Lexer.hs | |||
@@ -29,11 +29,11 @@ data BBToken = BBOpen Text [(Text, Maybe Text)] -- ^ Tag open with attributes | |||
29 | token :: Parser BBToken | 29 | token :: Parser BBToken |
30 | -- ^ Tokenizer | 30 | -- ^ Tokenizer |
31 | token = BBClose <$> ("[/" *> escapedText' [']'] <* "]") | 31 | token = BBClose <$> ("[/" *> escapedText' [']'] <* "]") |
32 | <|> uncurry BBOpen <$> openTag | 32 | <|> uncurry BBOpen <$ "[" <*> openTag <* "]" |
33 | <|> BBStr <$> escapedText ['['] | 33 | <|> BBStr <$> escapedText ['['] |
34 | 34 | ||
35 | openTag :: Parser (Text, [(Text, Maybe Text)]) | 35 | openTag :: Parser (Text, [(Text, Maybe Text)]) |
36 | openTag = (,) <$ "[" <*> escapedText' [']', ' ', '='] <*> attrs' <* "]" | 36 | openTag = (,) <$> escapedText' [']', ' ', '='] <*> attrs' |
37 | 37 | ||
38 | attrs :: Parser [(Text, Maybe Text)] | 38 | attrs :: Parser [(Text, Maybe Text)] |
39 | attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs' | 39 | attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs' |