Skip to content

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