microsoft / microsoft/vscode

Hybrid Markdown Editor: support \(...\) and \[...\] math delimiters

Open
#333,111 0 comments 0 reactions 1 assignee Claimed by @hediet View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Description

The experimental Hybrid Markdown Editor (`vscode.markdown.editor`) currently renders Markdown math using `$...$` and `$$...$$`, but does not recognize the standard LaTeX math delimiters:

```latex
\( ... \)
```

and:

```latex
\[
...
\]
```

This makes Markdown documents that use standard LaTeX/MathJax-style delimiters render incorrectly in the new Hybrid Markdown Editor.

## Steps to reproduce

1. Open a Markdown file in **Markdown Editor (Experimental)**.
2. Add the following content:

```markdown
Inline dollar syntax:

$E = mc^2$

Display dollar syntax:

$$
E = mc^2
$$

Inline LaTeX syntax:

\( E = mc^2 \)

Display LaTeX syntax:

\[
E = mc^2
\]
```

3. Observe the rendered document.

## Actual behavior

The dollar-delimited equations render correctly:

```markdown
$...$
$$...$$
```

However, the LaTeX-style delimiters are not recognized as math:

```latex
\(...\)
\[...\]
```

In particular, `\[...\]` is displayed as normal/raw Markdown content instead of a rendered display equation.

## Expected behavior

The Hybrid Markdown Editor should also recognize the commonly used LaTeX/MathJax delimiters:

```latex
\( ... \)
\[ ... \]
```

Alternatively, the editor could expose a setting allowing users to configure the accepted math delimiters.

For example, it would be useful to support both sets simultaneously:

* `$ ... $`
* `$$ ... $$`
* `\( ... \)`
* `\[ ... \]`

## Why this matters

`\(...\)` and `\[...\]` are standard LaTeX math delimiters and are also commonly supported by MathJax-based Markdown/documentation workflows.

Many technical Markdown documents are shared between Markdown renderers, LaTeX-oriented tooling, MathJax documentation, Pandoc, and other publishing systems. Requiring users to rewrite all `\[...\]` equations as `$$...$$` specifically for the Hybrid Markdown Editor creates unnecessary incompatibility.

Since the new Hybrid Markdown Editor is especially useful for editing technical Markdown in place, supporting these delimiters—or making the delimiter set configurable—would make it substantially more compatible with existing scientific and mathematical Markdown documents.

## Environment

Feature: **Markdown Editor (Experimental) / Hybrid Markdown Editor**

View type:

```text
vscode.markdown.editor
```

This issue is specific to the new Hybrid Markdown Editor rather than the traditional Markdown Preview.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.