Skip to content

[react-markdown] Youtube embeds in Markdown (remark, rehype, react) #742

Answered by ChristianMurphy
teinett asked this question in Q&A
Discussion options

You must be logged in to vote

There are a number of things going on here

rehypeSanitize

This removes iframes, the schema would need to be updated to include iframe tags https://github.com/rehypejs/rehype-sanitize#schema

Module not found: Can't resolve 'dns'

this is coming from next/webpack not polyfilling the package dns.

Error: runSync finished async. Use run instead

this is because react-markdown currently expects all plugins to be syncronous
https://github.com/remarkjs/react-markdown/blob/8ed18dafa8de638ab72a8db29f156f9fd9cf9e2e/src/react-markdown.js#L119
remark-oembed is async https://github.com/sergioramos/remark-oembed/blob/6df241fbb4ae07bcf1222d3a8ece36835273b8e1/index.js#L310
A closely related package ht…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@ChristianMurphy
Comment options

@teinett
Comment options

@teinett
Comment options

@wooorm
Comment options

@ChristianMurphy
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants