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

Upgrade to remark-parse@9+ #11828

Open
TrevorBurnham opened this issue Nov 17, 2021 · 6 comments
Open

Upgrade to remark-parse@9+ #11828

TrevorBurnham opened this issue Nov 17, 2021 · 6 comments
Labels
help wanted We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue! lang:markdown Issues affecting Markdown type:enhancement A potential new feature to be added, or an improvement to how we print something

Comments

@TrevorBurnham
Copy link

Prettier currently uses remark-parse@8 to parse Markdown/MDX. remark-parse@9 was released on Oct 14, 2020, switching it over to micromark: remarkjs/remark#536

Upgrading Prettier to remark-parse@9 (or newer) would fix the following reported bugs with Markdown parsing, and possibly others:

This is a non-trivial task because micromark uses a completely different plugin API, so all of Prettier's Markdown plugins will need to be updated or replaced.

@fisker fisker added lang:markdown Issues affecting Markdown type:enhancement A potential new feature to be added, or an improvement to how we print something help wanted We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue! labels Nov 19, 2021
@TrevorBurnham
Copy link
Author

I've opened up a WIP branch that uses the latest remark-parse: #11867 I'm hoping that other contributors will jump in and help get the plugins updated to use the new API. cc @sarayourfriend @fisker

@sosukesuzuki sosukesuzuki added this to the 3.0 milestone Mar 27, 2022
@fisker fisker removed this from the 3.0 milestone Feb 9, 2023
@fisker
Copy link
Sponsor Member

fisker commented Feb 9, 2023

Removed from v3 milestone, we'll continue work on it after v3 release.

@queengooborg
Copy link

queengooborg commented Jul 19, 2023

Hey there, I'm hoping to see if there's any progress on this issue. This is unfortunately a critical bug that is preventing us from properly adopting Prettier for all of MDN Web Docs documentation (especially in the localized content).

The issue I mentioned in #15032 is only one part of the problem. We're also running into issues with underscores/asterisks inside of links being replaced with the opposite symbol (which is a MUCH worse issue).

@seiyab
Copy link
Sponsor Contributor

seiyab commented Feb 12, 2024

I'm trying to upgrade remark-parse.
I have trouble with math syntax. Latest remark-parse and remark-math looks to parse some math-like code differently from before and desired escapes for $ look complex. I wonder if we can drop support for single-$ math since it tend to appear unintentionally #6213 (comment).

Re-implementing some in-house plugins like liquid and frontmatter looks feasible.

@seiyab
Copy link
Sponsor Contributor

seiyab commented Feb 12, 2024

Maybe latest remark-math has a regression bug: micromark/micromark-extension-math#6 Actually it is an intentional breaking change.

@seiyab
Copy link
Sponsor Contributor

seiyab commented Feb 13, 2024

A micromark member also suggests turning singleDollerTextMath off micromark/micromark-extension-math#6 (comment). Or, I'll try to implement our own plugin to keep current behavior.

seiyab added a commit to seiyab/prettier that referenced this issue Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We're a small group who can't get to every issue promptly. We’d appreciate help fixing this issue! lang:markdown Issues affecting Markdown type:enhancement A potential new feature to be added, or an improvement to how we print something
Projects
None yet
Development

No branches or pull requests

5 participants