Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDX and rehype-mathjax not rendering properly #6404

Closed
1 task
ewzpack opened this issue Mar 2, 2023 · 4 comments · Fixed by #6459
Closed
1 task

MDX and rehype-mathjax not rendering properly #6404

ewzpack opened this issue Mar 2, 2023 · 4 comments · Fixed by #6459
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) pkg: mdx Issues pertaining to `@astrojs/mdx` integration

Comments

@ewzpack
Copy link

ewzpack commented Mar 2, 2023

What version of astro are you using?

2.0.16

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm

What operating system are you using?

Windows

Describe the Bug

rehype-mathjax (CHTML) creates html structure and inject CSS, but the problem is that the CSS gets escaped

for example

mjx-container[jax="CHTML"] {
  line-height: 0;
}
mjx-stretchy-v > mjx-beg {
  height: 0;
}

instead of

mjx-container[jax="CHTML"] {
  line-height: 0;
}
mjx-stretchy-v > mjx-beg {
  height: 0;
}

Its works correctly when using markdown only or importing a .md file (containing math expression) into a .mdx file.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-r1w9pn?file=src/content/blog/math.mdx

Participation

  • I am willing to submit a pull request for this issue.
@y-nk
Copy link
Contributor

y-nk commented Mar 3, 2023

definitely related to #6327

@bluwy
Copy link
Member

bluwy commented Mar 7, 2023

Yeah this seems like the same issue as #6327. Keeping it separate for now to make sure we fix both script and style tags.

@bluwy bluwy added - P4: important Violate documented behavior or significantly impacts performance (priority) pkg: mdx Issues pertaining to `@astrojs/mdx` integration labels Mar 7, 2023
@bluwy bluwy self-assigned this Mar 8, 2023
@JerryWu1234
Copy link
Contributor

@bluwy, could you let me take a look at this bug?
I want to learn something about content modules.
thanks

@bluwy
Copy link
Member

bluwy commented Mar 8, 2023

I've already started working on this, so you might have to pick a different one 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority) pkg: mdx Issues pertaining to `@astrojs/mdx` integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants