Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/languages/scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
'selector': {
// Initial look-ahead is used to prevent matching of blank selectors
pattern:
/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,
/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\}|:{1,2}[-\w]+\((?:[^()]|\([^()]*\))*\))+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,
inside: {
'parent': {
pattern: /&/,
Expand Down
10 changes: 4 additions & 6 deletions tests/languages/scss/selector_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ p, div {}
&-sidebar {}
#context a%extreme {}
#{$selector}:before {}

foo :foo() bar {}
----------------------------------------------------

[
["selector", ["a "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", ["p, div "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", ["#foobar .foo "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", [["parent", "&"], ":hover "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", [["parent", "&"], "-sidebar "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", ["#context a", ["placeholder", "%extreme"]]], ["punctuation", "{"], ["punctuation", "}"],
["selector", [["variable", "#{$selector}"], ":before "]], ["punctuation", "{"], ["punctuation", "}"]
["selector", [["variable", "#{$selector}"], ":before "]], ["punctuation", "{"], ["punctuation", "}"],
["selector", ["foo :foo() bar "]], ["punctuation", "{"], ["punctuation", "}"]
]

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

Checks for selectors.
Checks for selectors.
Loading