-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 using Vite env var names in Markdown (#3412) #3471
Fix using Vite env var names in Markdown (#3412) #3471
Conversation
🦋 Changeset detectedLatest commit: 2312492 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Fantastic 🦛 !!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎 Looking Dam Good 🦛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change that should make our docs wayyyy simpler! Just curious though, are you still able to use import.meta.*
with explicit JSX expressions? Ex. If I wanted to insert import.meta.env.SITE
, could I use {import.meta.env.SITE}
? (my hunch is yes it works but just confirming)
What do you mean with "still able to use", @bholmesdev? This didn't work in Markdown before my changes, and it still doesn't! 😅 I can have a look and try to fix that, too. I agree it would be nice to actually be able to use those in Markdown, too. |
@hippotastic oh SHOOT I assumed it did work at some point! Well dang that’s a bummer. Still happy to approve this change 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very import
ant change 👏
Haha yeah, I also assumed that it works and was surprised to see that it didn't when I created this PR. 😅 The I'd therefore suggest to wrap this PR up first and separate making the JSX syntax work into a new PR. |
Changes
import.meta.env
in a Markdown file #3412 invite-plugin-markdown
by converting the first dot in every occurrence ofimport.meta.env.
to its Unicode escape sequence, which prevents Vite from replacing strings likeimport.meta.env.SITE
in our JS representation of loaded Markdown filesTesting
I added a new test case and ran all tests successfully.
Docs
Not a visible change, just a bugfix.