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

[MOD]: - Agregado soporte para atributos con valor 'null'. #175

Closed
wants to merge 1 commit into from

Conversation

boanergepro
Copy link

No description provided.

@dnfield
Copy link
Owner

dnfield commented Jun 11, 2019

This is not part of the SVG specification. I'd rather avoid implementing things that extend the SVG spec as much as possible.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 396

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 82.06%

Totals Coverage Status
Change from base Build 395: 0.0%
Covered Lines: 1386
Relevant Lines: 1689

💛 - Coveralls

@@ -49,7 +49,7 @@ String getAttribute(
raw = _getAttribute(el, name, namespace: namespace)?.trim();
}

return raw == '' || raw == null ? def : raw;
return raw == '' || raw == null || raw == 'null' ? def : raw;
Copy link
Owner

Choose a reason for hiding this comment

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

In this context, null could have semantic value for some reason - it might be an ID of a paint right? This function is also used for all attribute processing in XML.

It looks like Chrome would successfully render your SVG though. Perhaps we can make the parseColor function more tolerant so that it doesn't throw?

Alternatively, we could try to make the parser more tolerant of invalid values here the way Chrome is - the problem with that is it can be difficult to tell when an invalid value should allow us to continue or not.

Copy link
Author

Choose a reason for hiding this comment

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

You're right, from the context of the library there is no point in the complicated subject.

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.

None yet

3 participants