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 whitespace parsing #2

Merged
merged 2 commits into from
Dec 15, 2017
Merged

Fix whitespace parsing #2

merged 2 commits into from
Dec 15, 2017

Conversation

Gelio
Copy link
Contributor

@Gelio Gelio commented Dec 15, 2017

First of all, great library. It saved me some time!

I have had some problems when parsing an *.obj file I downloaded from the Internet.

It had two spaces after the initial token and another space at the end of the line, like so:

v  0.025350 0.026363 -0.050675 \n

It produced null values quite often.

I added a test for that case and fixed the parsing process by trimming each line and then splitting by multiple whitespace characters with a regex, instead of just a space as the delimiter.

@chinedufn
Copy link
Owner

Hey @Gelio !

Sorry that you ran into those whitespace issues.

Thanks so much for not only fixing it but also tossing in some tests. This is 🔥 ! LGTM!

@chinedufn chinedufn merged commit 6dba88b into chinedufn:master Dec 15, 2017
@chinedufn
Copy link
Owner

Just published wavefront-obj-parser@2.0.1. Thanks!

@Gelio Gelio deleted the fix-whitespace-parsing branch December 15, 2017 19:10
@Gelio
Copy link
Contributor Author

Gelio commented Dec 15, 2017

Wow, thank you for such a quick response!

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

2 participants