-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
Add warning about Prettier/plain Markdown formatters in Docs about MDC syntax #1709
Labels
enhancement
New feature or request
Comments
I think we can overwrite prettier's markdown parser to use remark/mdc. |
is there a workaround for this atm? |
Triloworld
added a commit
to Triloworld/content
that referenced
this issue
Sep 20, 2023
Connected to: nuxt#1709
7 tasks
MuhammadM1998
added a commit
to egytech-fyi/website-v2
that referenced
this issue
Jun 6, 2024
-- It isn't compatible with mdc syntax used by nuxt content (nuxt/content#1709)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe
After installing the MDC VSCode extension and trying to re-write my
.md
files with the MDC syntax (moving from @nuxt/content v1 to v2), it was frustrating to try writing MDC, save, and then the code is re-formatted back to Markdown format.The reason: I'm using Prettier for code formatting, and because the file is
.md
(just like normal Markdown), it has no way to know I want to use MDC syntax. Prettier's Parser automatically enables formatting on.md
files.Example (before: default Prettier, after: disabled Prettier on
![vscode-demo](https://user-images.githubusercontent.com/6360459/203980354-39643d95-42e5-45fc-a3dc-341ebd0bf728.gif)
.md
files w/.prettierignore
)Describe the solution you'd like
The Docs currently only mention installing the VSCode extension:
Likely there are others who will upgrade to Content v2, are using Prettier, and will encounter a similar issue with
.md
be re-formatted. I know this is not really an issue on the Nuxt ecosystem side. But maybe the Docs can mention a warning about it, to make things as smooth as possible. Even better would be if the Nuxt MDC VSCode extension could provide MDC formatting, but probably that would take more time to figure out.Suggestion: Add at least one sentence to the Docs that some additional configuration may be needed to tell VSCode which formatter to use, so that MDC is properly formatted instead of using Markdown formatting.
For example:
And a more detailed description section it links to:
Describe alternatives you've considered
.md
file is using MDC syntax and not plain Markdown?.mdc
extension like the MDX format (.mdx
) could make it easier to distinguish whether the file should be parsed as plain Markdown, MDC, etc.The text was updated successfully, but these errors were encountered: