Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support MDX as a separate language from Markdown #841

Open
1 task done
bates64 opened this issue May 28, 2024 · 2 comments
Open
1 task done

Support MDX as a separate language from Markdown #841

bates64 opened this issue May 28, 2024 · 2 comments

Comments

@bates64
Copy link

bates64 commented May 28, 2024

Check for existing issues

  • Completed

Describe the feature

Currently, people using Vale on MDX files tell Vale that it's just Markdown.

[formats]
mdx = md

But it isn't! MDX has clear differences from Markdown:

  • Comments are different Support custom comment patterns (e.g., MDX) #762
  • Vale must ignore lines that are actually JavaScript, i.e. those starting with import
  • Vale must ignore JSX expressions e.g. {1 +1}
  • Vale must not treat HTML as prose, i.e. <div foo="bar"> should not generate warnings (applies to Markdown also)
    Syntax reference
@discdiver
Copy link

+1

@ml4
Copy link

ml4 commented Feb 3, 2025

I cannot see any significant changes in the recent release history to suggest any different, but I see the ConfigGenerator has a MDX checkbox which uses a package - this would suggest this is officially supported but I get that it's worked around atm. I've tried with and without this and cannot get vale to even read mdx files so I wanted to check if the old way using [formats] worked still (my docs don't have any comments in so the approach referred above should work for me) with

StylesPath = .github/styles
MinAlertLevel = error
IgnoredScopes = code, tt, img, url, a
SkippedScopes = script, style, pre, figure, code
# Ignore code surrounded by backticks or plus sign, parameters defaults, URLs, and angle brackets.
Packages     = MDX

[formats]
mdx = md

[*.{md,mdx}]
BasedOnStyles = MyStyles

[*.mdx]
CommentDelimiters = {/*, */}

Thanks IA

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants