diff options
-rw-r--r-- | bbcode/test/Text/BBCode/LexerSpec.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bbcode/test/Text/BBCode/LexerSpec.hs b/bbcode/test/Text/BBCode/LexerSpec.hs index df96d52..e225fab 100644 --- a/bbcode/test/Text/BBCode/LexerSpec.hs +++ b/bbcode/test/Text/BBCode/LexerSpec.hs | |||
@@ -11,7 +11,7 @@ import Test.QuickCheck.Instances | |||
11 | import Text.BBCode.Lexer | 11 | import Text.BBCode.Lexer |
12 | 12 | ||
13 | import Data.Text (Text) | 13 | import Data.Text (Text) |
14 | import qualified Data.Text as T (singleton, replace, last, null) | 14 | import qualified Data.Text as T (singleton, replace, last, null, init) |
15 | 15 | ||
16 | import Data.Monoid ((<>), mconcat, Endo(..)) | 16 | import Data.Monoid ((<>), mconcat, Endo(..)) |
17 | import Data.List (intersperse) | 17 | import Data.List (intersperse) |
@@ -29,6 +29,7 @@ coToken (BBOpen t xs) = "[" <> escape [']'] t <> " " <> attrs <> " ]" | |||
29 | attrs = mconcat . intersperse " " $ map attr xs | 29 | attrs = mconcat . intersperse " " $ map attr xs |
30 | attr (key, "") = escape ['=', ']', ' '] key | 30 | attr (key, "") = escape ['=', ']', ' '] key |
31 | attr (key, val) = escape ['=', ']', ' '] key <> "=\"" <> escape ['\"'] val <> "\"" | 31 | attr (key, val) = escape ['=', ']', ' '] key <> "=\"" <> escape ['\"'] val <> "\"" |
32 | coToken (BBContained t xs) = (<> "/]") . T.init . coToken $ BBOpen t xs | ||
32 | coToken (BBClose t) = "[/" <> escape [']'] t <> "]" | 33 | coToken (BBClose t) = "[/" <> escape [']'] t <> "]" |
33 | coToken (BBStr t) = escape ['['] t | 34 | coToken (BBStr t) = escape ['['] t |
34 | 35 | ||