Allows more that one space between css selector.

This is needed to support addToken_ workaround before the fix.
Before the fix, an extra space was needed in the selector like this

example:

    addToken "form.foo "

With the fix adding the missing space, code already adding a space
will end up with two spaces between the scope selector and the input one :

    form.foo  input[name=token_]
This commit is contained in:
Maxime Bourget 2016-04-11 21:58:50 +01:00
parent 62fc67a444
commit 3fecebd5ba

View File

@ -51,7 +51,7 @@ parseQuery = parseOnly cssQuery
-- Below this line is the Parsec parser for css queries.
cssQuery :: Parser [[SelectorGroup]]
cssQuery = many (char ' ') >> sepBy rules (char ',' >> optional (char ' '))
cssQuery = many (char ' ') >> sepBy rules (char ',' >> many (char ' '))
rules :: Parser [SelectorGroup]
rules = many $ directChildren <|> deepChildren
@ -102,4 +102,4 @@ pSquare :: Parser a -> Parser a
pSquare p = char '[' *> p <* char ']'
pOptionalTrailingSpace :: Parser a -> Parser a
pOptionalTrailingSpace p = p <* optional (char ' ')
pOptionalTrailingSpace p = p <* many (char ' ')