Skip to content

Commit 0705f0b

Browse files
committed
allow @ in the middle of a word
1 parent a8eb0a6 commit 0705f0b

File tree

4 files changed

+5782
-5753
lines changed

4 files changed

+5782
-5753
lines changed

crates/tree-sitter-qmd/tree-sitter-markdown-inline/grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ module.exports = grammar(add_inline_rules({
384384
// lexer does not have to many different states, which makes it a lot easier to make
385385
// conflicts work.
386386
_word: $ => choice($._word_no_digit, $._digits),
387-
_word_no_digit: $ => new RegExp('[^' + PUNCTUATION_CHARACTERS_REGEX + ' \\t\\n\\r0-9]+(_+[^' + PUNCTUATION_CHARACTERS_REGEX + ' \\t\\n\\r0-9]+)*'),
387+
_word_no_digit: $ => new RegExp('[^' + PUNCTUATION_CHARACTERS_REGEX + ' \\t\\n\\r0-9]+([@_]+[^' + PUNCTUATION_CHARACTERS_REGEX + ' \\t\\n\\r0-9]+)*'),
388388
_digits: $ => /[0-9][0-9_]*/,
389389
_soft_line_break: $ => seq($._newline_token, optional($._last_token_whitespace)),
390390

crates/tree-sitter-qmd/tree-sitter-markdown-inline/src/grammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,7 @@
37193719
},
37203720
"_word_no_digit": {
37213721
"type": "PATTERN",
3722-
"value": "[^!-/:-@\\[-`\\{-~'^ \\t\\n\\r0-9]+(_+[^!-/:-@\\[-`\\{-~'^ \\t\\n\\r0-9]+)*"
3722+
"value": "[^!-/:-@\\[-`\\{-~'^ \\t\\n\\r0-9]+([@_]+[^!-/:-@\\[-`\\{-~'^ \\t\\n\\r0-9]+)*"
37233723
},
37243724
"_digits": {
37253725
"type": "PATTERN",

0 commit comments

Comments
 (0)