Skip to content

fix(markdown): prevent angle brackets from auto-closing inside math blocks#325464

Open
singhlovepreet9 wants to merge 1 commit into
microsoft:mainfrom
singhlovepreet9:fix-markdown-math-autoclose
Open

fix(markdown): prevent angle brackets from auto-closing inside math blocks#325464
singhlovepreet9 wants to merge 1 commit into
microsoft:mainfrom
singhlovepreet9:fix-markdown-math-autoclose

Conversation

@singhlovepreet9

Copy link
Copy Markdown

Fixes #272922

When typing < inside markdown math blocks ($ ... $), it currently auto-closes to <> because the markdown language configuration specifies that angle brackets should auto-close unless inside a string.

This PR assigns the meta.embedded.math.markdown scope to the string token type in extensions/markdown-math/package.json. This elegantly prevents the unwanted auto-closing of < inside LaTeX math blocks without requiring any renaming of textmate scopes.

Copilot AI review requested due to automatic review settings July 12, 2026 05:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents angle brackets from auto-closing inside Markdown math regions.

Changes:

  • Classifies Markdown math scopes as string tokens.
  • Includes an unrelated extension enablement action change that should be removed or split out.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
extensions/markdown-math/package.json Marks math scopes as string tokens.
src/vs/workbench/contrib/extensions/browser/extensionsActions.ts Alters global-disable action availability.

}
this.enabled = this.extension.state === ExtensionState.Installed
&& (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace)
&& (this.extension.enablementState === EnablementState.EnabledGlobally || (this.extension.enablementState === EnablementState.EnabledWorkspace && !this.extensionEnablementService.isDisabledGlobally(this.extension.local)))
@singhlovepreet9

Copy link
Copy Markdown
Author

@singhlovepreet9 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@singhlovepreet9 singhlovepreet9 force-pushed the fix-markdown-math-autoclose branch from a6f1c09 to 20489d3 Compare July 12, 2026 05:54
@singhlovepreet9 singhlovepreet9 marked this pull request as ready for review July 12, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Markdown] Do not auto close angle brackets inside latex blocks

2 participants