aboutsummaryrefslogtreecommitdiff
path: root/bbcode/src/Text/BBCode/Lexer.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bbcode/src/Text/BBCode/Lexer.hs')
-rw-r--r--bbcode/src/Text/BBCode/Lexer.hs4
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
29token :: Parser BBToken 29token :: Parser BBToken
30-- ^ Tokenizer 30-- ^ Tokenizer
31token = BBClose <$> ("[/" *> escapedText' [']'] <* "]") 31token = BBClose <$> ("[/" *> escapedText' [']'] <* "]")
32 <|> uncurry BBOpen <$> openTag 32 <|> uncurry BBOpen <$ "[" <*> openTag <* "]"
33 <|> BBStr <$> escapedText ['['] 33 <|> BBStr <$> escapedText ['[']
34 34
35openTag :: Parser (Text, [(Text, Maybe Text)]) 35openTag :: Parser (Text, [(Text, Maybe Text)])
36openTag = (,) <$ "[" <*> escapedText' [']', ' ', '='] <*> attrs' <* "]" 36openTag = (,) <$> escapedText' [']', ' ', '='] <*> attrs'
37 37
38attrs :: Parser [(Text, Maybe Text)] 38attrs :: Parser [(Text, Maybe Text)]
39attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs' 39attrs = (:) <$> (namedAttr <|> plainValue) <* takeWhile isSpace <*> attrs'