mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-08-17 12:00:29 +03:00
Support parsing classes with dashes and underscore
This commit is contained in:
parent
efa46019ef
commit
e525d2f17b
@ -335,7 +335,7 @@ cssRule acc =
|
||||
Parser.oneOf
|
||||
[ Parser.succeed (\selector -> Parser.Loop (Set.insert selector acc))
|
||||
|. Parser.token "."
|
||||
|= (Parser.chompWhile Char.isAlphaNum
|
||||
|= (Parser.chompWhile (\c -> Char.isAlphaNum c || c == '-' || c == '_')
|
||||
|> Parser.getChompedString
|
||||
)
|
||||
, Parser.end
|
||||
|
@ -94,7 +94,7 @@ import Html
|
||||
import Html.Attributes as Attr
|
||||
|
||||
view model =
|
||||
Html.span [ "known red" |> Attr.class ] []
|
||||
Html.span [ "known red-faint under_score" |> Attr.class ] []
|
||||
"""
|
||||
|> Review.Test.runWithProjectData projectWithCssClasses (defaults |> withCssFiles [ "*.css" ] |> rule)
|
||||
|> Review.Test.expectNoErrors
|
||||
@ -223,9 +223,12 @@ projectWithCssClasses =
|
||||
.known {
|
||||
color: blue;
|
||||
}
|
||||
.red {
|
||||
.red-faint {
|
||||
color: red;
|
||||
}
|
||||
.under_score {
|
||||
color: green;
|
||||
}
|
||||
"""
|
||||
}
|
||||
]
|
||||
@ -240,7 +243,7 @@ projectWithUnparsableCssClasses =
|
||||
.known {
|
||||
color: blue;
|
||||
}
|
||||
.red {
|
||||
.red-faint {
|
||||
color: red;
|
||||
-- missing closing curly brace
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user