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

Fix YAML properties with hyphens cause Build error #643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohamedsalem401
Copy link
Contributor

For issue #636:

  • After debugging, I discovered that MDX-Remote is the cause of this failure.
  • It seems to use YAML properties within a new function(arg1, arg2) format, where each argument corresponds to a YAML property. This requires the properties to be in a format that's a valid variable name (i.e., no spaces or strange characters).
  • MDX-Remote replaces variables in the content body with these YAML properties, like so:
---
my_name: "Mohamed"
---
My name is {my_name} // the output will be My name is Mohamed
  • This pull request replaces all hyphens/other characters in the YAML properties with underscores.
  • However, it doesn't handle cases where a user employs the YAML property as a variable value. Since this PR doesn't modify the content of the file itself (i.e., it won't change hyphens in the body {my-name} to underscores {my_name}), this scenario remains unaddressed.

Copy link

vercel bot commented Apr 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
flowershow-ssr-r2 ✅ Ready (Inspect) Visit Preview Apr 28, 2024 7:58pm

@rufuspollock
Copy link
Member

I'm not clear if this actually changes the file before processing by our mdx pipeline which will cause a bunch of issues - where does the modification happen?

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

Successfully merging this pull request may close these issues.

2 participants