Skip to content

fix: add mhchem support to markdown renderer#12612

Open
aaditmehtacoder wants to merge 1 commit into
continuedev:mainfrom
aaditmehtacoder:fix/katex-mhchem-12561
Open

fix: add mhchem support to markdown renderer#12612
aaditmehtacoder wants to merge 1 commit into
continuedev:mainfrom
aaditmehtacoder:fix/katex-mhchem-12561

Conversation

@aaditmehtacoder

@aaditmehtacoder aaditmehtacoder commented Jun 11, 2026

Copy link
Copy Markdown

Description

Adds the KaTeX mhchem contrib import to the GUI markdown renderer so chemistry notation like \ce{H2O} and \pu{...} can render correctly instead of causing KaTeX parsing errors.

Fixes #12561

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

Tested locally in the VS Code Extension Development Host. The block reaction $$\ce{CO2 + C -> 2 CO}$$ renders successfully as a typeset chemical reaction instead of crashing/stopping the message render.

Tests

Manual testing in the locally-built Continue extension:

  • Tested inline chemistry notation with $\ce{H2O}$
  • Tested ion notation with $\ce{Fe^{2+}}$
  • Tested block reaction rendering with $$\ce{CO2 + C -> 2 CO}$$
  • Tested units with $\pu{5 mol}$

Confirmed the message renders without stopping mid-output.


Summary by cubic

Add katex/contrib/mhchem to the GUI markdown renderer so chemistry notation (\ce{...}, \pu{...}) renders correctly instead of throwing KaTeX parse errors. Fixes #12561.

Written for commit dec323a. Summary will update on new commits.

Review in cubic

@aaditmehtacoder aaditmehtacoder requested a review from a team as a code owner June 11, 2026 22:46
@aaditmehtacoder aaditmehtacoder requested review from sestinj and removed request for a team June 11, 2026 22:46
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 11, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 1 file

Re-trigger cubic

@aaditmehtacoder

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

## Feature request: add KaTeX mhchem extension to the Markdown renderer

1 participant