diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-01-30 12:50:58 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-01-30 22:46:59 +0100 |
| commit | 8d1ce390e21ce0a5812a4211c893ec359906d6f1 (patch) | |
| tree | 5dbe1ad96af8ce8f9f01887340fe06025462e959 /tools/support/typst.tmLanguage.json | |
| parent | d7072f378fef733ae994fd9a1e767df4e4dd878e (diff) | |
Rework strong and emph
- Star and underscore not parsed as strong/emph inside of words
- Stars/underscores must be balanced and they cannot go over paragraph break
- New `strong` and `emph` classes
Diffstat (limited to 'tools/support/typst.tmLanguage.json')
| -rw-r--r-- | tools/support/typst.tmLanguage.json | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/support/typst.tmLanguage.json b/tools/support/typst.tmLanguage.json index 78809b4e..577804fc 100644 --- a/tools/support/typst.tmLanguage.json +++ b/tools/support/typst.tmLanguage.json @@ -44,15 +44,15 @@ }, { "name": "markup.bold.typst", - "begin": "\\*", - "end": "\\*|(?=\\])", + "begin": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))", + "end": "(^\\*|\\*$|((?<=\\W|_)\\*)|(\\*(?=\\W|_)))|\n|(?=\\])", "captures": { "0": { "name": "punctuation.definition.bold.typst" } }, "patterns": [{ "include": "#markup" }] }, { "name": "markup.italic.typst", - "begin": "_", - "end": "_|(?=\\])", + "begin": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))", + "end": "(^_|_$|((?<=\\W|_)_)|(_(?=\\W|_)))|\n|(?=\\])", "captures": { "0": { "name": "punctuation.definition.italic.typst" } }, "patterns": [{ "include": "#markup" }] }, |
