Skip to content

Commit

Permalink
feat: span & inline components
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed Jul 2, 2021
1 parent dfd6a60 commit 7b23c19
Showing 1 changed file with 106 additions and 4 deletions.
110 changes: 106 additions & 4 deletions syntaxes/mdc.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,104 @@
"scopeName": "text.markdown.docus",
"patterns": [
{
"include": "#component"
"include": "#component_block"
},
{
"include": "#markdown_attributes"
},
{
"include": "#span"
},
{
"include": "#component_inline"
}
],
"repository": {
"component": {
"markdown_attributes": {
"match": "([)])({)([^{]*)(})",
"name": "markup.component.attribute",
"captures": {
"3": {
"patterns": [
{
"include": "#attribute"
}
]
}
}
},
"span": {
"match": "(\\[)([^]]*)(\\])(({)([^{]*)(}))?",
"name": "markup.component.span",
"captures": {
"2": {
"name": "string.other.link.description.title.markdown"
},
"4": {
"patterns": [
{
"include": "#attributes"
}
]
}
}
},
"attributes": {
"match": "({)([^{]*)(})",
"name": "markup.attributes",
"captures": {
"2": {
"patterns": [
{
"include": "#attribute"
}
]
}
}
},
"component_inline": {
"match": "(^|\\G|\\s+)(:)(?i:(\\w[\\w\\d-]*))(({[^}]*})(\\[[^\\]]*\\]?)|(\\[[^\\]]*\\])({[^}]*})?)?",
"name": "markup.component.inline",
"captures": {
"2": {
"name": "punctuation.definition.tag.start.component"
},
"3": {
"name": "entity.name.tag.component"
},
"5": {
"patterns": [
{
"include": "#attributes"
}
]
},
"6": {
"patterns": [
{
"include": "#span"
}
]
},
"7": {
"patterns": [
{
"include": "#span"
}
]
},
"8": {
"patterns": [
{
"include": "#attributes"
}
]
}
}
},
"component_block": {
"begin": "(^|\\G)(\\s*)(:{2,})(?i:(\\w[\\w\\d-]*)(\\s+[^`]*|{([^{]*)})?$)",
"name": "markup.fenced_code.component.markdown",
"name": "markup.component.block",
"end": "(^|\\G)(\\2|\\s{0,2})(\\3)\\s*$",
"beginCaptures": {
"3": {
Expand Down Expand Up @@ -45,7 +136,18 @@
"contentName": "meta.embedded.block.component",
"patterns": [
{
"include": "text.html.markdown"
"begin": "(^|\\G)(\\s*)(-{3})([\\w]*)$",
"end": "(^|\\G)(\\s*)(-{3})\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.tag.start"
}
},
"patterns": [
{
"include": "text.html.markdown"
}
]
}
]
},
Expand Down

0 comments on commit 7b23c19

Please sign in to comment.