chore: scope subscript/superscript delimiters as punctuation.definition#21
Conversation
Follow-up polish from the #17 review. The ~ / ^ delimiters now get their own punctuation.definition.{subscript,superscript}.{begin,end}.rxiv scopes via captures, consistent with the existing markup.bold / markup.italic rules, so themes can style the delimiters independently of the content. Match behaviour is unchanged: the regexes still match H~2~O, CO~2~, E=mc^2^, x^n^ and still ignore ~~strikethrough~~ and [^1] footnotes. Folds into the unreleased 0.3.17 entry (no version bump). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review — PR #21: Scope subscript/superscript delimiters as
|
There was a problem hiding this comment.
Pull request overview
Minor polish PR that adds delimiter capture groups to the ~subscript~ and ^superscript^ grammar rules so the ~/^ characters receive their own punctuation.definition.{subscript,superscript}.{begin,end}.rxiv scopes, matching the convention already used by the bold, italic, raw, and math rules. Match behavior is unchanged; only capture grouping is added.
Changes:
- Wrap the opening and closing delimiters in capture groups and add a
capturesblock for the subscript and superscript grammar rules. - Extend the existing unreleased
0.3.17CHANGELOG entry to mention the new delimiter scopes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
syntaxes/rxiv-markdown.tmLanguage.json |
Adds delimiter captures to subscript/superscript rules. |
CHANGELOG.md |
Appends a note to the 0.3.17 entry about the new punctuation scopes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Optional polish flagged (and deferred) in the #17 review: the
~/^subscript/superscript delimiters now get their ownpunctuation.definition.{subscript,superscript}.{begin,end}.rxivscopes viacaptures, consistent with how the existingmarkup.bold/markup.italicrules scope their delimiters. This lets themes style the delimiters independently of the content; the default appearance is unchanged.Behaviour
Match behaviour is identical — only capture grouping was added. Verified the regexes still match
H~2~O,CO~2~,E=mc^2^,x^n^and still ignore~~strikethrough~~and[^1]footnotes.Folds into the unreleased
0.3.17CHANGELOG entry; no version bump.🤖 Generated with Claude Code