Skip to content

Commit e8c574c

Browse files
committed
fix: dash is also a valid identifier character
1 parent fba345e commit e8c574c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/content/docs/adventure/minimessage/specification.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ slug: adventure/minimessage/specification
44
description: A developer-facing specification of the MiniMessage format.
55
tableOfContents:
66
minHeadingLevel: 2
7-
maxHeadingLevel: 5
7+
maxHeadingLevel: 4
88
---
99

1010
This document outlines the MiniMessage format in detail to aid developers who wish to implement their own MiniMessage
@@ -189,7 +189,7 @@ This section defines miscellaneous behavior of common parts.
189189

190190
### Identifiers
191191

192-
All identifiers must be lowercased and contain only alphanumerical characters or `_`. All identifiers
192+
All identifiers must be lowercased and contain only alphanumerical characters, `_`, or '-'. All identifiers
193193
used as named argument names should be unique.
194194

195195
### Quoting
@@ -285,5 +285,5 @@ alphanumeric → "a" | "b" | "c" | "d"
285285
| "y" | "z" | "_" | "0"
286286
| "1" | "2" | "3" | "4"
287287
| "5" | "6" | "7" | "8"
288-
| "9"
288+
| "9" | "-"
289289
```

src/utils/shiki/mm.tmLanguage.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"patterns": [
55
{
66
"name": "meta.tag.mm",
7-
"begin": "(</?)([a-z_0-9]+)",
7+
"begin": "(</?)([a-z_0-9-]+)",
88
"beginCaptures": {
99
"1": { "name": "punctuation.definition.tag.mm" },
1010
"2": { "name": "constant.language.identifier.identifier.mm" }
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"name": "variable.parameter.named-argument.quoted.mm",
43-
"match": "(\\s+)([a-z_0-9]+)(=)(\".*\")",
43+
"match": "(\\s+)([a-z_0-9-]+)(=)(\".*\")",
4444
"captures": {
4545
"2": { "name": "keyword.reserved.identifier.mm" },
4646
"3": { "name": "punctuation.definition.identifier.mm" },
@@ -49,7 +49,7 @@
4949
},
5050
{
5151
"name": "variable.parameter.named-argument.single-quoted.mm",
52-
"match": "(\\s+)([a-z_0-9]+)(=)('.*')",
52+
"match": "(\\s+)([a-z_0-9-]+)(=)('.*')",
5353
"captures": {
5454
"2": { "name": "keyword.reserved.identifier.mm" },
5555
"3": { "name": "punctuation.definition.identifier.mm" },
@@ -58,7 +58,7 @@
5858
},
5959
{
6060
"name": "variable.parameter.named-argument.unquoted.mm",
61-
"match": "(\\s+)([a-z_0-9]+)(=)([^ >:]*)",
61+
"match": "(\\s+)([a-z_0-9-]+)(=)([^ >:]*)",
6262
"captures": {
6363
"2": { "name": "keyword.reserved.identifier.mm" },
6464
"3": { "name": "punctuation.definition.identifier.mm" },
@@ -67,14 +67,14 @@
6767
},
6868
{
6969
"name": "variable.parameter.inverse-flag.mm",
70-
"match": "(\\s+)(![a-z_0-9]+)",
70+
"match": "(\\s+)(![a-z_0-9-]+)",
7171
"captures": {
7272
"2": { "name": "support.type.inverse-flag.mm" }
7373
}
7474
},
7575
{
7676
"name": "variable.parameter.flag.mm",
77-
"match": "(\\s+)([a-z_0-9]+)",
77+
"match": "(\\s+)([a-z_0-9-]+)",
7878
"captures": {
7979
"2": { "name": "support.type.flag.mm" }
8080
}

0 commit comments

Comments
 (0)