-
Notifications
You must be signed in to change notification settings - Fork 142
Conversation
was too greedy and broke other grammars
Could you also update the specs? |
@@ -363,7 +363,7 @@ | |||
'entities': | |||
'patterns': [ | |||
{ | |||
'begin': '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)' | |||
'begin': '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(?=;)' |
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.
What do you think of rewriting the grammar to
'match': '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)'
'captures':
'1':
'name': 'punctuation.definition.entity.begin.html'
'2':
'name': 'entity.name.entity.other.html'
'3':
'name': 'punctuation.definition.entity.end.html'
'name': 'constant.character.entity.html'
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.
I think that's the better way forward since entities aren't able to wrap around anything.
Swapped to use match instead of the begin/end semantic. Also corrected spec changes. |
/cc @DavidePastore I may have to revert your change in order to fix the recent regressions regarding ampersands (such as #141). Any suggestions? |
@50Wliu thanks for the cc. The fact is that |
@DavidePastore - I'm not a regex guru but I can't think of any way to have that functionality and not break the rest of the spec. It will constantly try to eat the rest of the document (or line at a minimum with a change) thinking you're still writing an entity. It is possible to preserve autocomplete but it would require you to write |
I'm reverting this for now and will investigate alternative options later. |
@JonathanWolfe - Yes, you're right. I'm not a regex guru either. |
Caused JonathanWolfe/language-polymer#1. Just need a simple lookahead assertion.