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

Using with gatsby-plugin-mdx results in undefined HTML parent tag #12

Open
muuvmuuv opened this issue Mar 2, 2020 · 2 comments
Open

Comments

@muuvmuuv
Copy link

muuvmuuv commented Mar 2, 2020

I just added your plugin and it seems to work totally fine but looking at the generated code it seems that it has an undefined parent element. I couldn't find the source where it resolves to undefined.

My repo: https://github.com/muuvmuuv/portfolio (development branch)

I have not uploaded the videos yet, so you must remove the videos in content/projects/additive-tv/index.md and content/projects/influxe-gaming/index.md. After that add a video in one project file.

Bildschirmfoto 2020-03-02 um 21 02 46

@muuvmuuv
Copy link
Author

muuvmuuv commented Mar 2, 2020

I'm using YouTube now, because it makes more sense with large video files. Here is the link to the last commit that produced this bug: https://github.com/muuvmuuv/portfolio/tree/6684199f5762829b5fc2db4481bc66936f10e241

@PaulBunker
Copy link

You would need to change "html" to "jsx" on the following line
https://github.com/Mike-Dax/gatsby-remark-videos/blob/master/src/index.js#L135

This is because the AST for mdx is slightly different

Change this into a self closing tag here

return `<source src="${video.src}" type="video/${video.fileExtension}">`

This is because jsx demands all tags to be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants