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

Support video tag with poster attribute #189

Merged
merged 4 commits into from
Feb 28, 2025

Conversation

itmammoth
Copy link
Contributor

Hi,
This PR adds support for the <video> tag by converting the poster attribute into a Markdown image.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video

Thanks.

Summary (Copilot generated :octocat:)

This pull request adds support for converting HTML video elements to Markdown format in the markdownify library. The changes include a new conversion method and corresponding tests.

New feature: Video element conversion

  • markdownify/__init__.py: Added a convert_video method to handle the conversion of HTML video elements to Markdown. This method checks for the presence of src and poster attributes and formats the output accordingly.

Testing the new feature

  • tests/test_conversions.py: Added a test_video function to verify the correct conversion of video elements with different attributes to Markdown.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Collaborator

@AlexVonB AlexVonB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! If you have time for it, please check the change request.

One thing we should probably ignore is the <source> tag that can occur inside the video tag. But if you have a good idea how to include this as well, feel free to do so!

@AlexVonB AlexVonB merged commit ac5736f into matthewwithanm:develop Feb 28, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants