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

hyphens and quotes in markdown code fence results in missing content with production builds #1325

Open
thescientist13 opened this issue Nov 18, 2024 · 0 comments
Assignees
Labels
bug Something isn't working CLI
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Nov 18, 2024

Type of Change

Bug

Summary

Observed in ProjectEvergreen/www.greenwoodjs.dev#139 that we had this bit of markdown in our docs

We can go one step further and instruct Greenwood to strip out the `<script>` tags for these components by adding the `data-gwd-opt="static"` attribute to them, since we have no need for any interactivity on these components.

That renders fine in development
image

but disappeared in a production build! 😱
Screenshot 2024-11-18 at 1 25 19 PM


It seems specific to the use of - and " I guess because we have a similar piece of content type="module" that renders just fine 🤷‍♂️

Greenwood is ECMAScript Modules (ESM) first, as shown with the usage of the `type="module"` attribute in the example below:

Screenshot 2024-11-18 at 1 27 04 PM

and removing the - is fine
image

Details

So I tried a number of things to debug, and nothing really seemed to help

  1. Update all markdown related deps to latest using npm overrides
    "rehype-raw": "^7.0.0",
    "rehype-stringify": "^10.0.1",
    "remark-frontmatter": "^5.0.0",
    "remark-parse": "^11.0.0",
    "remark-rehype": "^10.0.0",
    "unified": "^11.0.5",
  2. Tried HTML entities like &quot
  3. Disabled prerender: true in greenwood.config.js

It seems like an interim solution that works is just single quotes

We can go one step further and instruct Greenwood to strip out the `<script>` tags for these components by adding the `data-gwd-opt='static'` attribute to them, since we have no need for any interactivity on these components.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working CLI
Projects
Development

No branches or pull requests

1 participant