Skip to content

Use largest srcset URL in <img> elements (#305)#510

Open
stygian-ash wants to merge 1 commit intomixmark-io:masterfrom
stygian-ash:issue-305
Open

Use largest srcset URL in <img> elements (#305)#510
stygian-ash wants to merge 1 commit intomixmark-io:masterfrom
stygian-ash:issue-305

Conversation

@stygian-ash
Copy link
Copy Markdown

Close #305. If an image has a srcset attribute, use the largest source from there in place of the src attribute. This is useful as some websites (notably Tumblr) do not set a src for most images. Without these changes, Turndown would not render these images.

I'm interested in this issue because it causes problems saving certain webpages with obsidianmd/obsidian-clipper, which has Turndown as a dependency. I figured it would be better to fix the issue here than submit a PR there. Also, this is my first open-source contribution, so please let me know if I'm doing anything wrong :)

If an image has a `srcset` attribute, use the largest source from there
in place of the `src` attribute.
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.

use srcset in <img> elements

1 participant