Skip to content

Commit

Permalink
CSS-extras: match attribute inside selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Golmote committed Jul 7, 2016
1 parent d6b5c2f commit 13fed76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/prism-css-extras.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Prism.languages.css.selector = {
'pseudo-element': /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
'pseudo-class': /:[-\w]+(?:\(.*\))?/,
'class': /\.[-:\.\w]+/,
'id': /#[-:\.\w]+/
'id': /#[-:\.\w]+/,
'attribute': /\[[^\]]+\]/
}
};

Expand Down
2 changes: 1 addition & 1 deletion components/prism-css-extras.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tests/languages/css!+css-extras/selector_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ foo#bar {

#foo > .bar:not(baz):after {

div[foo="bar"] {

----------------------------------------------------

[
Expand Down Expand Up @@ -43,6 +45,11 @@ foo#bar {
["class", ".bar"],
["pseudo-class", ":not(baz)"],
["pseudo-element", ":after"]
]], ["punctuation", "{"],

["selector", [
"div",
["attribute", "[foo=\"bar\"]"]
]], ["punctuation", "{"]
]

Expand Down

0 comments on commit 13fed76

Please sign in to comment.