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

Convert video tags to links #104

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

evanrmurphy
Copy link

@evanrmurphy evanrmurphy commented Aug 12, 2016

Currently, node-html-to-text ignores video tags. This PR adds support for video tags similar to img tags.

So if a video is encountered in either of these formats, with a src attribute or source tag...

<video src="http://example.com/a.mp4">
<video>
  <source src="http://example.com/a.mp4">
<video>

...it will output a bracketed link to the video:

[http://example.com/a.mp4]

It also adds an ignoreVideo option that works the same way as ignoreImage.

This would resolve issue #103.

My team is finding your library very useful. Thanks for creating it!

Don't strip out `<video>` tags completely, rather convert
them to bracketed links like is done for images.

Relates to html-to-text#103
Also correct spacing (tabs, not spaces) in `formatVideo` function.
`video` tags don't have `alt` attributes.
Before only recognized `video` tags with a `src` attribute. Now
if no `src` attribute is found, check for a `source` child element.
@mlegenhausen
Copy link
Member

Thanks for your pull request. Before I can accept it I need some unit tests for the new feature. Please add some test cases to the test/html-to-text.js file.

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.

2 participants