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

🐛 BUG: syntax error on next sibling of <Markdown> element if the Markdown body ends with HTML #1541

Closed
amagee opened this issue Oct 13, 2021 · 2 comments
Milestone

Comments

@amagee
Copy link

amagee commented Oct 13, 2021

What package manager are you using?

pnpm

What operating system are you using?

Linux

Describe the Bug

If:

  1. I have a <Markdown> element in my page, and
  2. The content of the <Markdown> element is either empty or ends with HTML, and
  3. There is content after the end of the <Markdown> element,

then I get a syntax error that looks like SyntaxError: [76:7]: Unexpected token: ','.

Steps to Reproduce

  1. npm init astro using any template

  2. Create the following .astro file:

---
import { Markdown } from 'astro/components';
---
<html>
  <body>
    <div>
      <Markdown>
        <div />
      </Markdown>
      oops
    </div>
  </body>
</html>
  1. Output: SyntaxError: [76:7]: Unexpected token: ','

Expected: oops

Notes:

  • Putting some text after the <div /> inside the <Markdown> makes the problem go away
  • Removing the oops makes the problem go away

Link to Minimal Reproducible Example (Optional)

No response

@natemoo-re
Copy link
Member

Fixed in #1406! See https://stackblitz.com/edit/astro-v5dscj?file=src%2Fpages%2Findex.astro for working repro with next

@natemoo-re natemoo-re added this to the v0.21 milestone Nov 1, 2021
@natemoo-re
Copy link
Member

Following up on my previous comment, the team has decided to close out issues that have been confirmed as fixed by astro@0.21.0-next.0, astro@0.21.0-next.1, or astro@0.21.0-next.2. Our hope is that this will help the v0.21 milestone remain as actionable as possible.

To verify that this issue has been fixed, you may

  • Open a new astro@next project on StackBlitz
  • Locally upgrade to the astro@next preview
    npm i astro@next
    # If using Framework renderers...
    npm i @astrojs/renderer-name@next

If you think we made a mistake, please reopen this issue!

If you run into any other problems with astro@next, please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants