Skip to content

Commit b25d9e2

Browse files
authored
More odoc syntax color (ocamllabs#2029)
* Recursive math braces * Fix links * Changelog
1 parent c71ed46 commit b25d9e2

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## Unreleased
44

55
- Add syntax highlighting support for Rocq 9.0 dune plugin. (#2026)
6+
- Fix syntax highlighting for odoc links and odoc math blocks with deeply nested
7+
braces (#2029)
68

79
## 2.0.1
810

syntaxes/ocamldoc.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,22 @@
191191
"patterns": [{ "include": "#lighttable" }]
192192
},
193193
{
194-
"comment": "ocamldoc links",
195-
"begin": "(?<!\\\\){({:[[:space:]].*?})",
194+
"comment": "ocamldoc links with alt-text",
195+
"begin": "(?<!\\\\){({:.*?})",
196196
"beginCaptures": {
197197
"1": { "name": "string.other.link.title.markdown.ocamldoc" }
198198
},
199199
"end": "(?<!\\\\)\\}",
200200
"patterns": [{ "include": "#markup" }],
201201
"name": "markup.underline.link.ocamldoc meta.link.ocamldoc"
202202
},
203+
{
204+
"comment": "ocamldoc links",
205+
"match": "(?<!\\\\)({:.*?})",
206+
"captures": {
207+
"1": { "name": "string.other.link.title.markdown.ocamldoc" }
208+
}
209+
},
203210
{
204211
"comment": "ocamldoc latex",
205212
"begin": "(?<!\\\\){\\%([[:space:]]|latex:)",
@@ -307,7 +314,8 @@
307314
"patterns": [
308315
{
309316
"begin": "(?<!\\\\){",
310-
"end": "(?<!\\\\)\\}"
317+
"end": "(?<!\\\\)\\}",
318+
"patterns": [{ "include": "#braces" }]
311319
}
312320
]
313321
}

0 commit comments

Comments
 (0)