withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.65k stars 2.48k forks source link

🐛 BUG: Trailing commas in parentheses get removed from markdown #1525

Closed tusharsadhwani closed 2 years ago

tusharsadhwani commented 3 years ago

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

If you have this code:

<Markdown>
  ```python
  (a,)


It gets rid of the trailing comma. Output:

```python
(a)

Steps to Reproduce

Codesandbox below :)

Link to Minimal Reproducible Example (Optional)

https://codesandbox.io/s/pensive-goldstine-gz6ry?file=/src/pages/index.astro

tusharsadhwani commented 3 years ago

This is awkward as my blog is meant to teach people Python, but removing a trailing comma from a tuple with a single item completely breaks the code example. I'm not sure what a good workaround would be for this for the time being, so if that can be figured out in the meantime I'd be happy with that as well.

tusharsadhwani commented 3 years ago

Related: #1147

matthewp commented 3 years ago

Can you try this against astro@next and let me know i the same problem occurs?

tusharsadhwani commented 3 years ago

@matthewp I tried running it with astro@next--compiler, and this is what I got: image

matthewp commented 3 years ago

Thanks, that's being tracked in #1406

matthewp commented 3 years ago

Trying to verify this is fixed, blocked by https://github.com/snowpackjs/astro/issues/1735

matthewp commented 3 years ago

Ok, I can verify this will be fixed in next! https://stackblitz.com/edit/github-jhuzfh?file=src/pages/index.astro

tusharsadhwani commented 3 years ago

Wait, isn't next already merged? Not released I suppose?

natemoo-re commented 2 years ago

@tusharsadhwani Yes, next is merged to main. It's released under astro@next, but will be upgraded to astro as soon as possible.

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

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.