Skip to content

Commit

Permalink
Fix #21
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Aug 26, 2020
1 parent 8c3b445 commit 3a7e618
Show file tree
Hide file tree
Showing 6 changed files with 3,579 additions and 103 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add `jinja-html` language, which embeds `jinja` language. [#24](https://github.com/shikijs/shiki/issues/24).
- Remove `vue-html` language. Either use `vue` or `html` language.
- Fix `php` syntax highlighting. [#21](https://github.com/shikijs/shiki/issues/21).

### 0.2.0 | 2020-08-24

Expand Down
189 changes: 189 additions & 0 deletions packages/languages/data/php-html.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/atom/language-php/blob/master/grammars/html.cson",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/atom/language-php/commit/b6c5e83016b52311cdc622c2579462861ee91587",
"name": "php-html",
"scopeName": "text.html.php",
"injections": {
"L:source.php string.quoted.single.sql.php source.sql.embedded.php": {
"patterns": [
{
"match": "(#)(\\\\'|[^'])*(?='|$)",
"name": "comment.line.number-sign.sql",
"captures": {
"1": {
"name": "punctuation.definition.comment.sql"
}
}
},
{
"match": "(--)(\\\\'|[^'])*(?='|$)",
"name": "comment.line.double-dash.sql",
"captures": {
"1": {
"name": "punctuation.definition.comment.sql"
}
}
},
{
"match": "\\\\[\\\\'`\"]",
"name": "constant.character.escape.php"
},
{
"match": "\"(?=((\\\\\")|[^\"'])*('|$))",
"name": "string.quoted.double.unclosed.sql"
}
]
},
"L:source.php string.quoted.double.sql.php source.sql.embedded.php": {
"patterns": [
{
"match": "(#)(\\\\\"|[^\"])*(?=\"|$)",
"name": "comment.line.number-sign.sql",
"captures": {
"1": {
"name": "punctuation.definition.comment.sql"
}
}
},
{
"match": "(--)(\\\\\"|[^\"])*(?=\"|$)",
"name": "comment.line.double-dash.sql",
"captures": {
"1": {
"name": "punctuation.definition.comment.sql"
}
}
},
{
"match": "\\\\[\\\\'`\"]",
"name": "constant.character.escape.php"
},
{
"match": "(')([^'\\\\]*)(')",
"name": "string.quoted.single.sql",
"captures": {
"1": {
"name": "punctuation.definition.string.begin.sql"
},
"2": {
"patterns": [
{
"include": "source.php#interpolation_double_quoted"
}
]
},
"3": {
"name": "punctuation.definition.string.end.sql"
}
}
},
{
"match": "(`)([^`\\\\]*)(`)",
"name": "string.quoted.other.backtick.sql",
"captures": {
"1": {
"name": "punctuation.definition.string.begin.sql"
},
"2": {
"patterns": [
{
"include": "source.php#interpolation_double_quoted"
}
]
},
"3": {
"name": "punctuation.definition.string.end.sql"
}
}
},
{
"match": "'(?=((\\\\')|[^'\"])*(\"|$))",
"name": "string.quoted.single.unclosed.sql"
},
{
"include": "source.php#interpolation_double_quoted"
}
]
},
"text.html.php - (meta.embedded | meta.tag), L:((text.html.php meta.tag) - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.js - (meta.embedded.block.php | meta.embedded.line.php)), L:(source.css - (meta.embedded.block.php | meta.embedded.line.php))": {
"patterns": [
{
"include": "#php-tag"
}
]
}
},
"patterns": [
{
"begin": "\\A#!",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.php"
}
},
"end": "$",
"name": "comment.line.shebang.php"
},
{
"include": "text.html.derivative"
}
],
"repository": {
"php-tag": {
"patterns": [
{
"begin": "<\\?(?i:php|=)?(?![^?]*\\?>)",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.php"
}
},
"end": "(\\?)>",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.php"
},
"1": {
"name": "source.php"
}
},
"name": "meta.embedded.block.php",
"contentName": "source.php",
"patterns": [
{
"include": "source.php"
}
]
},
{
"begin": "<\\?(?i:php|=)?",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.php"
}
},
"end": "(\\?)>",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.php"
},
"1": {
"name": "source.php"
}
},
"name": "meta.embedded.line.php",
"contentName": "source.php",
"patterns": [
{
"include": "source.php"
}
]
}
]
}
}
}
Loading

0 comments on commit 3a7e618

Please sign in to comment.