astro icon indicating copy to clipboard operation
astro copied to clipboard

🐛 BUG: Could not parse expression with acorn: Expecting Unicode escape sequence \uXXXX

Open victor0x16 opened this issue 3 years ago • 1 comments

What version of astro are you using?

1.0.0-beta.56

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

None

What package manager are you using?

npm

What operating system are you using?

Windows

Describe the Bug

Rendering mathematical expressions in Markdown works/worked 1.0.0-beta.31, but it is not working anymore.

My code:

// file.md
<Fragment is:raw>
   $$f(x) = \pm A \sin\left(\frac{2\pi}{4} + \theta\right)$$
</Fragment>

The output should be: $$f(x) = \pm A \sin\left(\frac{2\pi}{4} + \theta\right)$$

But I get an Error:

Could not parse expression with acorn: Expecting Unicode escape sequence \uXXXX

Link to Minimal Reproducible Example

https://codesandbox.io/s/affectionate-flower-rc6f81?file=/src/pages/posts/MathMath.md

Participation

  • [ ] I am willing to submit a pull request for this issue.

victor0x16 avatar Jun 26 '22 04:06 victor0x16

Hello! I just wanted to link this issue with https://github.com/withastro/compiler/issues/436, which was also created between betas 31 and 33

sylvinus avatar Jul 05 '22 19:07 sylvinus

Hey @victor0x16 and @sylvinus! Astro 1.0 has been released and we no longer run .md files through the Astro compiler!

This should make things like this much easier, and I can confirm that this issue is now fixed. See working repro.

natemoo-re avatar Aug 11 '22 20:08 natemoo-re

@natemoo-re awesome, thanks!

sylvinus avatar Aug 11 '22 20:08 sylvinus