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
sandboxproperty to the list of properties that should allow spaces.Without this fix, using
gatsby-remark-embedded-codesandboxalong withgatsby-plugin-mdxresults in aniframewith asandboxattribute ofallow-modals,allow-forms,allow-popups,allow-scripts,allow-same-origin, even thoughgatsby-remark-embedded-codesandboxis 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-codesandboxdoes appear to be doing everything right however, returning anode.valuewith asandboxattribute separated by spaces. It seems like MDX itself is changing the spaces to commas...Fixes elboman/gatsby-remark-embedded-codesandbox#7
cc @timneutkens @elboman