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

Commit

Permalink
Merge pull request #142 from JonathanWolfe/patch-1
Browse files Browse the repository at this point in the history
Fix HTML Entities regex
  • Loading branch information
Wliu authored Nov 3, 2016
2 parents 2f8b9d1 + cdd621f commit 06a3202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions grammars/html.cson
Original file line number Diff line number Diff line change
Expand Up @@ -348,15 +348,13 @@
'entities':
'patterns': [
{
'begin': '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)'
'beginCaptures':
'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'
'end': ';'
'endCaptures':
'0':
'3':
'name': 'punctuation.definition.entity.end.html'
'name': 'constant.character.entity.html'
}
Expand Down
2 changes: 1 addition & 1 deletion spec/html-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe 'HTML grammar', ->
expect(tokens[0]).toEqual value: '&', scopes: ['text.html.basic', 'invalid.illegal.bad-ampersand.html']
expect(tokens[3]).toEqual value: 'amp', scopes: ['text.html.basic', 'constant.character.entity.html', 'entity.name.entity.other.html']
expect(tokens[4]).toEqual value: ';', scopes: ['text.html.basic', 'constant.character.entity.html', 'punctuation.definition.entity.end.html']
expect(tokens[7]).toEqual value: 'a', scopes: ['text.html.basic', 'constant.character.entity.html', 'entity.name.entity.other.html']
expect(tokens[7]).toEqual value: 'a', scopes: ['text.html.basic']

describe "firstLineMatch", ->
it "recognises HTML5 doctypes", ->
Expand Down

0 comments on commit 06a3202

Please sign in to comment.