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

<video> tags not being processed correctly #26

Closed
4 tasks done
ghost opened this issue Sep 4, 2023 · 6 comments
Closed
4 tasks done

<video> tags not being processed correctly #26

ghost opened this issue Sep 4, 2023 · 6 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@ghost
Copy link

ghost commented Sep 4, 2023

Initial checklist

Affected packages and versions

"rehype-raw": "^6.1.1"

Link to runnable example

No response

Steps to reproduce

I am using the following code:

<figure>
  <video width="100%" height="100%" controls >
    <source src="example.mp4" type="video/mp4" />
    <p>
      Your browser doesn't support HTML video. Here is a
      <a href="example.mp4">link to the video</a> instead.
    </p>
  </video>
  <figcaption class="figure-caption">example.mp4</figcaption>
</figure>

on a .md file in NextJS (Node v20, NPM 9).

Expected behavior

A video should be rendered on the resulting HTML page.

Actual behavior

A video is not rendered and upon closer inspection, an img tag is being spat out instead.

Runtime

Other (please specify in steps to reproduce)

Package manager

Other (please specify in steps to reproduce)

OS

Linux

Build and bundle tools

Next.js

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Sep 4, 2023
@Murderlon Murderlon added the 🙊 open/needs-repro This needs a reproduction label Sep 4, 2023
@github-actions

This comment has been minimized.

@wooorm
Copy link
Member

wooorm commented Sep 4, 2023

try 7.0.0, it contains syntax-tree/hast-util-raw@e66705a.

@ghost
Copy link
Author

ghost commented Sep 4, 2023

Upgraded.
I put this:

<video width="100%" height="auto" controls>
  <source src="/example.mp4" type="video/mp4" />
  Your browser does not support the video tag.
</video>

This is output in dev tools:
image

Paths are correct and no error in console. Interestingly, img tags (and all other HTML) render as expected. This only has to do with video. Video encoding has been checked and it loads fine directly in browser.

@Murderlon
Copy link
Member

Here you can see it working as expected: https://stackblitz.com/edit/github-aeyswk?file=src%2Fmain.ts

This is probably an issue with your config, for which there is not enough information to help.

@ghost
Copy link
Author

ghost commented Sep 4, 2023

Indeed, it's been my config. Sanitize was the culprit.

I have video showing now with the help of the docs and your example.

Thanks and closing.

@ghost ghost closed this as completed Sep 4, 2023
@github-actions

This comment has been minimized.

@wooorm wooorm added the 🤷 no/invalid This cannot be acted upon label Sep 4, 2023
@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually 🙊 open/needs-repro This needs a reproduction labels Sep 4, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants