flowershow
flowershow copied to clipboard
Fix YAML properties with hyphens cause Build error
For issue #636:
- After debugging, I discovered that
MDX-Remoteis 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-Remotereplaces 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.
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 |
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?