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

Only scan list-tyle-image css value if it is a string #988

Merged
merged 1 commit into from
Sep 5, 2016

Conversation

ianyh
Copy link
Contributor

@ianyh ianyh commented Aug 1, 2016

In some cases--the only one I have found so far is inline svg urls--the value for a list-tyle-image is actually an array (it gets split on commas). Previously, parsing the list style would crash. Now we only parse it if it is a string. For reference, here is the line that caused the crash:

list-style-image: = url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF=-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%=20version%3D%221.1%22%20width%3D%225%22%20height%3D%2213%22%3E%0A%3Ccircle=%20cx%3D%222.5%22%20cy%3D%229.5%22%20r%3D%222.5%22%20fill%3D%22%2300528c%2=2%2F%3E%0A%3C%2Fsvg%3E%0A);

In some cases--the only one I have found so far is inline svg urls--the value for a list-tyle-image is actually an array (it gets split on commas). Previously, parsing the list style would crash. Now we only parse it if it is a string. For reference, here is the line that caused the crash:

```css
list-style-image: = url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF=-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%=20version%3D%221.1%22%20width%3D%225%22%20height%3D%2213%22%3E%0A%3Ccircle=%20cx%3D%222.5%22%20cy%3D%229.5%22%20r%3D%222.5%22%20fill%3D%22%2300528c%2=2%2F%3E%0A%3C%2Fsvg%3E%0A);
```
@coveralls
Copy link

Coverage Status

Coverage remained the same at 58.98% when pulling be4d803 on ianyh:list-style-crash into ded41c9 on Cocoanetics:develop.

@odrobnik
Copy link
Collaborator

odrobnik commented Aug 2, 2016

This doesn't handle the array though, right?

@ianyh
Copy link
Contributor Author

ianyh commented Aug 2, 2016

Correct. In the case I ran into handling the array wasn't actually meaningful. I suppose the values could have been joined and then parsed instead of ignored. I'll give that a try.

@odrobnik
Copy link
Collaborator

odrobnik commented Sep 4, 2016

@ianyh So will there be an addition to this pull request for handing an array, or should we merge this as is?

@ianyh
Copy link
Contributor Author

ianyh commented Sep 5, 2016

I couldn't really figure out a way to make it general, so this can probably just get merged as is.

@odrobnik odrobnik merged commit 5e7ce46 into Cocoanetics:develop Sep 5, 2016
@odrobnik odrobnik added the Bug label Sep 26, 2016
@odrobnik odrobnik added this to the 1.6.18 milestone Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants