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

fix: make external svg files referred to in use tags work #427

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

Conversation

strindhaug
Copy link

@strindhaug strindhaug commented Aug 29, 2023

Description

I noticed that when using html-to-image on our website it crashed with mysterious errors about invalid queries.
I realised that the code does not handle external files in use-tags in an inline SVG.

Motivation and Context

Fix for #425 (and also implicitly for #392 )

Also in order for the test case to be useful I reduced the allowed number of incorrect pixels from 100 to 2, thus somewhat addressing #426 it could possibly now be a little too sensitive on other platforms such as Windows that use a different font rendering, but at least the new test and all the old tests ran om my Mac.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

Self Check before Merge

  • My code follows the code style of this project. (I think I have, I have at least linted and added several comments explaining my thought process)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@biiibooo
Copy link
Contributor

biiibooo bot commented Aug 29, 2023

👋 @strindhaug

💖 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:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add graph.scale() method
  • docs: graph.getShortestPath is now available

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

  • Follow the TypeScript coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

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.

@biiibooo biiibooo bot added the feature label Aug 29, 2023
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch coverage: 95.45% and no project coverage change.

Comparison is base (b751cbf) 62.93% compared to head (225e357) 62.93%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #427   +/-   ##
=======================================
  Coverage   62.93%   62.93%           
=======================================
  Files          10       10           
  Lines         580      580           
  Branches      143      143           
=======================================
  Hits          365      365           
  Misses        151      151           
  Partials       64       64           
Files Changed Coverage Δ
src/clone-node.ts 71.42% <95.45%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@strindhaug
Copy link
Author

Btw, apparently I have a newer pnpm version because when I initialised the repo the pnpm-lock.yaml was modified automatically. Looking at the diff it's mostly updating the pnpm version number and reordered slightly. I chose not to commit this change to avoid lots of pointless autogenerated diffs.

@strindhaug
Copy link
Author

BTW: Looks like 🏷️ Label(Patch Size) / run (pull_request_target) is misconfigured, it seems to try to pull data about this PR but from my account where this PR is not present (and if I had made a PR to myself for some reason, it probably would not have the id 427).

I see several other PR's have this check failing.

@Tilesto
Copy link

Tilesto commented Oct 27, 2023

Please, merge it((

Copy link

@1van0v 1van0v left a comment

Choose a reason for hiding this comment

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

LGTM!

@ZhongxuYang
Copy link

Thanks to this PR, making a patch saved me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants