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

Make string matching non-greedy to fix parsing @font-face blocks and CSS w/o much newlines. #1

Merged
merged 1 commit into from Jun 21, 2016

Conversation

roblillack
Copy link

@roblillack roblillack commented Jun 20, 2016

This pull request changes the parsing of string tokens to be non-greedy. This way multiple strings in one line do not get recognized as a single string.

Two rather complex test-cases are included, too.

@thejerf thejerf merged commit f48201b into thejerf:master Jun 21, 2016
@thejerf
Copy link
Owner

thejerf commented Jun 21, 2016

A nice PR, thanks.

If I am reading this correctly, you should only have had this problem with apostrophe-delimited strings. The Gorilla code I pulled this from appears to have tried to simplify the string tokens (or they used an older definition?), and in the process ended up permitting apostrophes legally instead of apostrophe-delimited strings. Making this a lazy matcher resolves this slightly differently than the standard, but I believe it works correctly, by inspection.

@roblillack
Copy link
Author

Thanks for merging.

You might also want to tag v1.0.1.

@thejerf
Copy link
Owner

thejerf commented Jun 21, 2016

Crud, I always forget that "git push" doesn't push tags on its own. I actually had. :)

@roblillack
Copy link
Author

git config push.followTags true 👍

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