flowershow icon indicating copy to clipboard operation
flowershow copied to clipboard

Fix YAML properties with hyphens cause Build error

Open mohamedsalem401 opened this issue 1 year ago • 2 comments

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.

mohamedsalem401 avatar Apr 28 '24 19:04 mohamedsalem401

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

vercel[bot] avatar Apr 28 '24 19:04 vercel[bot]

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?

rufuspollock avatar Jun 01 '24 20:06 rufuspollock