Skip to content

feat: support Math in Markdown#299

Merged
DMartens merged 17 commits into
mainfrom
lumirlumir-patch-1
May 18, 2026
Merged

feat: support Math in Markdown#299
DMartens merged 17 commits into
mainfrom
lumirlumir-patch-1

Conversation

@lumirlumir
Copy link
Copy Markdown
Member

@lumirlumir lumirlumir commented Jan 27, 2026

Prerequisites checklist

What is the purpose of this pull request?

This PR updates Code Explorer to support the Math parsing option for the Markdown language, introduced in eslint/markdown#617 and released as part of @eslint/markdown v8.

I've also updated e2e-tests/options.test.ts to include tests for the newly added Math option.

What changes did you make? (Give an overview)

  • Before:
image
  • After:
image image

Related Issues

Ref: eslint/markdown#331

Is there anything you'd like reviewers to focus on?

Actually, adding AST node interaction and expansion tests would make this feature more robust, but there are currently no tests for those cases. I’d like to continue the work on #398, since it requires many of the changes.

@eslintbot eslintbot added this to Triage Jan 27, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Jan 27, 2026
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Jan 27, 2026
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jan 27, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 27, 2026

Deploy Preview for eslint-code-explorer ready!

Name Link
🔨 Latest commit 6ea2f1b
🔍 Latest deploy log https://app.netlify.com/projects/eslint-code-explorer/deploys/6a0b1bd1ef6feb000844d896
😎 Deploy Preview https://deploy-preview-299--eslint-code-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@jookira
Copy link
Copy Markdown

jookira commented Mar 31, 2026

@lumirlumir, I wanted to share some constructive feedback on your PRs:

  1. I’ve noticed that refactors and fixes/features are sometimes combined in the same PR. Splitting these into separate PRs would make the logic changes easier to review and merge.
  2. Tasks like this one seem to be taking a few hours, where I’d expect something closer to ~30 minutes. I’d suggest utilizing AI tools for the boilerplate and tests to help speed things up.

@lumirlumir lumirlumir requested a review from Copilot April 20, 2026 13:31
@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage Apr 20, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in Code Explorer for the new math parsing option in the Markdown language (introduced in @eslint/markdown v8), including a UI toggle and an e2e test update.

Changes:

  • Add a new markdownMath boolean option (type + default) and expose it in the Markdown options panel.
  • Pass math through to @eslint/markdown’s parser via languageOptions.
  • Bump @eslint/markdown to ^8.0.1 and extend the e2e options-panel test to assert the new switch is visible.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lib/const.ts Adds markdownMath to the default Markdown options.
src/hooks/use-explorer.ts Extends MarkdownOptions to include markdownMath.
src/hooks/use-ast.ts Wires markdownMath into the markdown parser languageOptions.
src/components/options.tsx Adds a new “Math” switch to the Markdown options UI.
package.json Updates @eslint/markdown dependency to v8.
package-lock.json Lockfile updates for @eslint/markdown@8 and its transitive deps/engines.
e2e-tests/options.test.ts Adds an assertion that the “Math” switch is visible for Markdown.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/options.tsx
Comment thread src/hooks/use-ast.ts
Comment thread package.json Outdated
Comment thread src/hooks/use-explorer.ts
@lumirlumir lumirlumir moved this from Needs Triage to Implementing in Triage Apr 28, 2026
@Pixel998 Pixel998 mentioned this pull request Apr 28, 2026
3 tasks
key => window.localStorage.getItem(key),
storageKey,
);
return page.evaluate(key => {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just refactored the test helper code a bit to follow the existing convention:

async function getPersistedJavaScriptCode(page: Page): Promise<string> {
return page.evaluate(key => {
const storedValue = window.localStorage.getItem(key);
if (!storedValue) {
return "";
}
return JSON.parse(storedValue).state.code.javascript;
}, storageKey);
}

async function getStoredHashValue(page: Page): Promise<string> {
return page.evaluate(key => {
return (
new URLSearchParams(window.location.hash.slice(1)).get(key) ?? ""
);
}, storageKey);
}

@lumirlumir lumirlumir moved this from Implementing to Needs Triage in Triage May 18, 2026
@lumirlumir lumirlumir marked this pull request as ready for review May 18, 2026 14:04
Copy link
Copy Markdown
Contributor

@DMartens DMartens left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thanks.

@DMartens DMartens merged commit b3e8071 into main May 18, 2026
11 checks passed
@DMartens DMartens deleted the lumirlumir-patch-1 branch May 18, 2026 20:29
@github-project-automation github-project-automation Bot moved this from Needs Triage to Complete in Triage May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion feature

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

5 participants