timlrx / tailwind-nextjs-starter-blog

This is a Next.js, Tailwind CSS blogging starter template. Comes out of the box configured with the latest technologies to make technical writing a breeze. Easily configurable and customizable. Perfect as a replacement to existing Jekyll and Hugo individual blogs.
https://tailwind-nextjs-starter-blog.vercel.app/
MIT License
8.45k stars 1.96k forks source link

Image syntax for videos do not work e.g. ![](/static/demo.mp4) #824

Closed juskek closed 7 months ago

juskek commented 7 months ago

Describe the bug Using the following syntax throws an error: example.mdx

![](/static/demo.mp4)

console error

 [ERROR] TypeError: Cannot read properties of null (reading 'width')
...

Expected behavior A video should be shown in the article

juskek commented 7 months ago

Seems like the markdown processor does not support videos in image tags?

I used html instead:

<video
      width="100%"
      style={{ width: '100%', height: '100%', position: 'relative', borderRadius: '0.25rem' }}
      autoPlay
      loop
      muted
    >
      <source src={src} type={type} />
    </video>
timlrx commented 7 months ago

Yes, you are right. It's not part of the gfm spec: https://github.github.com/gfm/, though it is supported in GIthub and thus not supported by remark-gfm as well.