Skip to content

Commit be9327e

Browse files
authored
Merge pull request #2 from alesanchezr/master
added html syntax highlighting for html inside strings
2 parents 74704f3 + 0cf8bd4 commit be9327e

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

docs/python-string-sql-1.1.0.vsix

220 KB
Binary file not shown.

package.json

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
"embeddedLanguages": {
2727
"meta.embedded.sql": "sql"
2828
}
29+
},
30+
{
31+
"path": "./syntaxes/highlight-html-string.json",
32+
"scopeName": "python-html.injection",
33+
"injectTo": [
34+
"source.python"
35+
],
36+
"embeddedLanguages": {
37+
"meta.embedded.block.html": "html"
38+
}
2939
}
3040
],
3141
"snippets": [

syntaxes/highlight-html-string.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"fileTypes": [
3+
"py"
4+
],
5+
"injectionSelector": "L:string.quoted.multi.python, L:meta.fstring.python - (comment.line.number-sign.python, punctuation.definition.comment.python)",
6+
"repository": {
7+
"keep-variables": {
8+
"patterns": [
9+
{
10+
"begin": "\\{",
11+
"end": "\\}",
12+
"beginCaptures": {
13+
"1": {
14+
"name": "punctuation.section.embedded.begin.py"
15+
},
16+
"2": {
17+
"name": "punctuation.section.embedded"
18+
}
19+
},
20+
"endCaptures": {
21+
"1": {
22+
"name": "punctuation.section.embedded.end.py"
23+
},
24+
"2": {
25+
"name": "punctuation.section.embedded"
26+
}
27+
},
28+
"patterns": [
29+
{
30+
"include": "text.html.derivative"
31+
}
32+
]
33+
}
34+
]
35+
}
36+
},
37+
"patterns": [
38+
{
39+
"begin": "( *--html| *--beginhtml| *--begin-html)",
40+
"end": "( *--\\!html| *--endhtml| *--end-html)",
41+
"captures": {
42+
"1": {
43+
"name": "variable.parameter"
44+
}
45+
},
46+
"patterns": [
47+
{
48+
"include": "text.html.derivative"
49+
},
50+
{
51+
"include": "#keep-variables"
52+
}
53+
]
54+
}
55+
],
56+
"scopeName": "python-html.injection"
57+
}

0 commit comments

Comments
 (0)