bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.39k stars 503 forks source link

fix: add possibility to use own handling of onerror which will not en… #453

Open misino opened 4 months ago

misino commented 4 months ago

…d up in the exception

Description

Motivation and Context

We had a problem with generating an image when html contained pictures with src pointing to a domain which doesn't allow CORS. This change is about possibility to specify own onerror callback which don't need to make whole image generation fail.

Types of changes

Self Check before Merge

vivcat[bot] commented 4 months ago

👋 @misino

💖 Thanks for opening this pull request! 💖

Please follow the contributing guidelines. And we use semantic commit messages to streamline the release process.

Examples of commit messages with semantic prefixes:

Things that will help get your PR across the finish line:

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

codecov[bot] commented 4 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (b751cbf) 62.93% compared to head (3b6fd62) 63.10%. Report is 11 commits behind head on master.

Files Patch % Lines
src/embed-images.ts 50.00% 1 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #453 +/- ## ========================================== + Coverage 62.93% 63.10% +0.17% ========================================== Files 10 10 Lines 580 580 Branches 143 143 ========================================== + Hits 365 366 +1 Misses 151 151 + Partials 64 63 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.