Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Rewrite id selector to be more standards-compliant #79

Merged
merged 2 commits into from
Aug 26, 2016
Merged

Rewrite id selector to be more standards-compliant #79

merged 2 commits into from
Aug 26, 2016

Conversation

hediyi
Copy link
Contributor

@hediyi hediyi commented Aug 25, 2016

No description provided.

'''
'name': 'entity.other.attribute-name.class.css'
}
{
'captures':
'1':
'name': 'punctuation.definition.entity.css'
'match': '(#)[a-zA-Z][a-zA-Z0-9_-]*'
'match': '''(?x)
(\\#)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for escape

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that # usually doesn't need escaping. But in extended mode (?x), # becomes a metacharacter, denoting the start of a comment—if you don't escape it, the following ) will be interpreted as comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right.

hediyi added 2 commits August 26, 2016 09:01
<id-selector> = <hash-token>

with the restriction that the <hash-token>'s value must be an
identifier, which has the same syntax as <ident-token>:

  * may contain only
    * [a-zA-Z0-9_-]
    * ISO 10646 characters U+00A0 and higher
  * must not begin with [0-9]
  * must not begin with '-' followed by [0-9]
  * must be at least 2 characters long if begins with '-'
@winstliu winstliu merged commit 42679c6 into atom:master Aug 26, 2016
@hediyi hediyi deleted the rewrite-id-selector branch August 26, 2016 02:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants