llllllllll / slider

Utilities for working with osu! files and data
https://llllllllll.github.io/slider/index.html
GNU Lesser General Public License v3.0
39 stars 17 forks source link

fix beatmap parsing failing on beatmaps with whitespace on empty lines #78

Closed tybug closed 3 years ago

tybug commented 4 years ago

Some (presumably manually edited) beatmaps have whitespace on otherwise empty lines, which was causing slider to treat the whitespace as the line value. Closes https://github.com/llllllllll/slider/issues/71

llllllllll commented 4 years ago

should we just strip each line and and then do the rest of the parsing? Is whitespace meaningful anywhere else?

tybug commented 4 years ago

I don't see anywhere that the beatmap format relies on whitespace at the beginning or end of a line, so I think such whitespace can only be harmful and we should strip it.

I actually found another place where whitespace is harmful, which is at the beginning or end of a tag like [Metadata], which will cause this check https://github.com/llllllllll/slider/blob/a84d493e568a4c099433f99770b3b698862baab4/slider/beatmap.py#L1853-L1857

to fail. So I'm in favor of simply parsing the stripped version.

tybug commented 3 years ago

@llllllllll just had someone run into this again, if you have time to review this that would be great

llllllllll commented 3 years ago

LGTM, thanks for circling back to this.