Skip to content

Commit

Permalink
fix(syntax): don't tokenize attribute body something.ref with aurelia…
Browse files Browse the repository at this point in the history
… ref, resolves: #19
  • Loading branch information
erik-lieben committed Nov 5, 2016
1 parent e5741f7 commit 43528bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
8 changes: 4 additions & 4 deletions syntaxes/html.json
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@
}
},
"tag-aurelia-attribute-with-ref-attribute": {
"match": "[^=](([a-zA-Z0-9:-]+)(?<!controller|view|view-model)(\\.)(ref))",
"match": "(?<![\"'-])([a-zA-Z0-9:-]+)(?<!controller|view|view-model)(\\.)(ref)(?![\"'-;])",
"captures": {
"2": {
"1": {
"name": "entity.other.attribute-name.html"
},
"3": {
"2": {
"name": "punctuation.definition.tag.begin.html"
},
"4": {
"3": {
"name": "ref.attribute.html.au"
}
}
Expand Down
14 changes: 14 additions & 0 deletions test/syntax.html/ref.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,18 @@ describe('The Aurelia HTML syntax ref attribute', () => {

});

it('must not tokenize client.ref* part in body of other attribute', () => {

// arrange
let scope = 'meta.tag.block.any.html';

// act
let lineToken = tokenizeLine('<div data-reference-id="client.referenceId">');

// assert
let token = getTokenOnCharRange(lineToken, 24, 42);
assert.isOk(hasScope(token.scopes, scope));

});

});

0 comments on commit 43528bb

Please sign in to comment.