-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Stringify another array property #715
Conversation
This pull request is automatically deployed with Now. Latest deployment for this branch: https://mdx-git-fork-karlhorky-patch-1.mdx.now.sh |
@johno Is there a reason https://github.com/syntax-tree/hast-to-hyperscript isn’t used? It does exactly all this for both React and Vue! |
I remember it does too much conversion. We wanted the available properties for users to override to be MDAST elements not HAST elements. Eg there's no |
Ahh, right, this is MDXHAST, not hast 🤔 We could move the attribute handling in Alternatively, I’d suggest to depend on |
Yeah, I think we'd need a handful of changes so it'd work the way we want for MDX. That said, at the very least, we should break out a lot of this shared code into a package/file these libraries could share. Though we should probably make that it's own issue. I'm cool merging this as is since it fixes something that's indeed broken while we investigate how we can better implement the MDXHAST to JSX conversion. |
Yup, agreed! |
Cools, will do. Thanks for the PR @karlhorky! |
No worries, thanks for the merge / release! |
Building on @devongovett's #158, this adds the
sandbox
property to the list of properties that should allow spaces.Without this fix, using
gatsby-remark-embedded-codesandbox
along withgatsby-plugin-mdx
results in aniframe
with asandbox
attribute ofallow-modals,allow-forms,allow-popups,allow-scripts,allow-same-origin
, even thoughgatsby-remark-embedded-codesandbox
is correctly returning space-separated strings.If this is truly the correct solution, then probably we should include other HTML properties that accept spaces.
If there's a better / more correct way of doing this, I'm all ears! The remark plugin
gatsby-remark-embedded-codesandbox
does appear to be doing everything right however, returning anode.value
with asandbox
attribute separated by spaces. It seems like MDX itself is changing the spaces to commas...Fixes elboman/gatsby-remark-embedded-codesandbox#7
cc @timneutkens @elboman