Skip to content

Commit 29f2abe

Browse files
committed
Better handle attribute values, add license
1 parent 8b7b2a7 commit 29f2abe

File tree

4 files changed

+51
-18
lines changed

4 files changed

+51
-18
lines changed

CHANGELOG.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
# Change Log
2+
## 0.0.1
23

3-
All notable changes to the "knockoutjs-templates" extension will be documented in this file.
4-
5-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
6-
7-
## [Unreleased]
8-
9-
- Initial release
4+
- Initial release

LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Copyright 2021- Yaroslav Fedevych
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice,
7+
this list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
3. Neither the name of the copyright holder nor the names of its contributors
14+
may be used to endorse or promote products derived from this software
15+
without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18+
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20+
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22+
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23+
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
25+
OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,11 @@ as either a comment, or a string, and this is not useful.
1313
This extension will make Visual Studio Code highlight these fragments as Javascript,
1414
which is way more helpful in finding out what was wrong with those errors parsing bindings.
1515

16-
## Known Limitations
16+
## Limitation
1717

18+
It won't highlight Javascript in the value of the `data-bind` attribute if it's enclosed in single quotes,
19+
only in double quotes.
20+
21+
## Bugs
22+
23+
This extension does not contain bugs.

syntaxes/knockoutjs-databind.tmLanguage.json

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@
44
"injectionSelector": "L:meta.attribute.data-x.data-bind.html",
55
"patterns": [
66
{
7-
"match": "\"([^\"]+)\"",
8-
"captures": {
9-
"1": {
10-
"name": "meta.embedded.inline.javascript",
11-
"patterns": [
12-
{
13-
"include": "source.js"
14-
}
15-
]
7+
"begin": "\\G(\")",
8+
"end": "(?<!\\G)\\1",
9+
"beginCaptures": {
10+
"0": {
11+
"name": "punctuation.definition.knockoutjs.bindings.start"
1612
}
17-
}
13+
},
14+
"endCaptures": {
15+
"0": {
16+
"name": "punctuation.definition.knockoutjs.bindings.end"
17+
}
18+
},
19+
"contentName": "meta.embedded.inline.javascript",
20+
"patterns": [
21+
{
22+
"include": "source.js"
23+
}
24+
]
1825
}
1926
]
2027
}

0 commit comments

Comments
 (0)