Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: svg color url not to lower #53

Merged
merged 4 commits into from
Oct 21, 2021
Merged

fix: svg color url not to lower #53

merged 4 commits into from
Oct 21, 2021

Conversation

joda-divid
Copy link
Contributor

fixes #52

@joda-divid joda-divid requested a review from xpopy October 20, 2021 07:45
@joda-divid joda-divid self-assigned this Oct 20, 2021
@codecov
Copy link

codecov bot commented Oct 20, 2021

Codecov Report

Merging #53 (a831ca9) into master (7d2d346) will increase coverage by 12.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #53       +/-   ##
===========================================
+ Coverage   48.19%   60.36%   +12.17%     
===========================================
  Files         108      109        +1     
  Lines        2106     2112        +6     
  Branches      422      422               
===========================================
+ Hits         1015     1275      +260     
+ Misses        963      683      -280     
- Partials      128      154       +26     
Impacted Files Coverage Δ
...sts__/pdf/test-defs/single-image-svg-color-hex.tsx 100.00% <ø> (ø)
...sts__/pdf/test-defs/single-image-svg-color-url.tsx 100.00% <100.00%> (ø)
...rc/abstract-document-exporters/pdf/render-image.ts 43.33% <100.00%> (+4.44%) ⬆️
...stract-document/src/abstract-document/resources.ts 72.72% <0.00%> (+6.06%) ⬆️
...nt/src/abstract-document-exporters/pdf/paginate.ts 63.71% <0.00%> (+6.19%) ⬆️
...src/abstract-document-exporters/pdf/pre-process.ts 30.50% <0.00%> (+11.86%) ⬆️
...bstract-document-exporters/shared/get_resources.ts 78.57% <0.00%> (+32.14%) ⬆️
...src/abstract-document-exporters/pdf/update-refs.ts 71.73% <0.00%> (+32.60%) ⬆️
...ent/src/abstract-document-exporters/pdf/measure.ts 80.36% <0.00%> (+42.94%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d2d346...a831ca9. Read the comment docs.

@@ -66,7 +66,7 @@ function abstractComponentToPdf(
index = indexEnd;

const color = svgUpdated.substring(indexStart, indexEnd);
if (color !== color.toLocaleLowerCase())
if (color !== color.toLocaleLowerCase() && color.toLowerCase().indexOf("url") === -1)
Copy link
Contributor

Choose a reason for hiding this comment

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

You could check for url( instead of url which would make sure we dont miss burlywood as a color.

@xpopy xpopy merged commit 5d66236 into master Oct 21, 2021
@xpopy xpopy deleted the feature/svgcolorurlfix branch October 21, 2021 06:56
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fill color by url does not work
2 participants