This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Fix custom element selectors #64
Closed
hansottowirtz
wants to merge
8
commits into
atom:master
from
hansottowirtz:fix_custom_element_selectors
Closed
Fix custom element selectors #64
hansottowirtz
wants to merge
8
commits into
atom:master
from
hansottowirtz:fix_custom_element_selectors
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You know you can run the specs locally in Atom or a CLI, right? |
Yes, I found that out :) I hoped this would be a quick fix, but after the first pull request failed I did some more research and tested it. |
'name': 'entity.name.tag.css' | ||
} | ||
{ | ||
'match': '\\b([a-zA-Z0-9]+(-[a-zA-Z0-9]+)+)(?=\\.|\\s++[^:]|\\s*[,{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-child()|nth-last-child()|nth-of-type()|nth-last-of-type()|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid|:shadow)(\\([0-9A-Za-z]*\\))?)' | ||
'match': '\\b(?<=\\s|^|,)(?<![\\.\\:\\)\\]-])([a-zA-Z0-9-]*)\\b(?=(?:\\.[a-z-]+|::?[a-z-]+(\\(.*\\))?|\\[.+\\])*\\s*({|,|\\s*(?=[\\[:.*#a-zA-Z])))' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
([a-zA-Z0-9-]+)
would be a safer choice here I think.
@@ -483,15 +483,15 @@ | |||
] | |||
'selector': | |||
'begin': '\\s*(?=[\\[:.*#a-zA-Z])' | |||
'end': '(?=[/@{)])' | |||
'end': '(?=[\\/@{\\)])' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Oniguruma, the only characters that need to be escaped to be used literally in a character class are \[]-^
.
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I fixed some tokening problems for custom tags, the regexes now look for a {, a space, or the begin of another element. Now they work better with [] and :: after them. Also added some escaping on line 486 for clarity, and stopped matching more than 2 :'s on line 519. Added a test, and changed one because it did not have a {.