Skip to content

Commit

Permalink
Merge pull request DongyuZhao#2 from s-arash/master
Browse files Browse the repository at this point in the history
Added support for alloy code blocks in markdown
  • Loading branch information
DongyuZhao authored Feb 11, 2019
2 parents a2c4ac1 + 2af49dd commit 0c80f14
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.1.4

Added support for Alloy code blocks in markdown

### 0.1.3

Fix some issues, thanks for Arash Sahebolamri.
Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Alloy VSCode",
"description": "Alloy analyzer language support",
"repository": "https://github.com/DongyuZhao/vscode-alloy",
"version": "0.1.3",
"version": "0.1.4",
"publisher": "DongyuZhao",
"engines": {
"vscode": "^1.12.0"
Expand All @@ -30,7 +30,17 @@
"language": "alloy",
"scopeName": "source.als",
"path": "./syntaxes/alloy.tmLanguage.json"
}
},
{
"scopeName": "markdown.alloy.codeblock",
"path": "./syntaxes/alloy.markdown.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.alloy": "alloy"
}
}
]
},
"__metadata": {
Expand Down
28 changes: 28 additions & 0 deletions syntaxes/alloy.markdown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"fileTypes": [],
"injectionSelector": "L:markup.fenced_code.block.markdown",
"patterns": [
{
"include": "#superjs-code-block"
}
],
"repository": {
"superjs-code-block": {
"begin": "(?<=[`~])alloy(\\s+[^`~]*)?$",
"end": "(^|\\G)(?=\\s*[`~]{3,}\\s*$)",
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.alloy",
"patterns": [
{
"include": "source.als"
}
]
}
]
}
},
"scopeName": "markdown.alloy.codeblock"
}

0 comments on commit 0c80f14

Please sign in to comment.