aboutsummaryrefslogtreecommitdiff
path: root/bbcode
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-12 06:12:11 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-12 06:12:11 +0000
commit934558d25aa1074483ef722236e1e680abf13ebf (patch)
treee2bfde68b11cd62239ed814d86a165eb89223ea3 /bbcode
parent9bc6cd27e1c4b52f46e1b210b3d560c5340d1fe4 (diff)
downloadthermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar
thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.gz
thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.bz2
thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.tar.xz
thermoprint-934558d25aa1074483ef722236e1e680abf13ebf.zip
cleanup
Diffstat (limited to 'bbcode')
-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'