-
Notifications
You must be signed in to change notification settings - Fork 19
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
Attempting to prevent multiple indentions of notes #72
Conversation
Update: Instead of using regex to remove the first tab, instead the text is split on this regex: r"[\n|\r|\r\n]\t*" Should match cross-platform newlines, plus a tab character if it's present. Results in a nice clean list: NEWLINE_RE = re.compile(r"[\n|\r|\r\n]\t*")
text = "List1\n\tList2\n\tList3"
NEWLINE_RE.split(text)
>>> ("List1", "List2", "List3") It replaces a
|
Update based on @alerque suggestion: Removes Regex and uses ufoNormalizer/tests/test_ufonormalizer.py Lines 831 to 837 in 5b67c7a
|
…tions Ben Kiel noted in the issue discussion
I made some revisions, following the advice that @benkiel made here. Now all tests are passing. I added a This and a few extra lines of stripping allow all the tests to pass: Finally, added additional tests to test for the case @benkiel brought up and other related cases: |
Thanks @colinmford! |
This should fix #71 if approved.
It uses regex to remove the first tab in each line of a multi-paragraph text block.
Test added to make sure
does not change when it goes through
_normalizeGlifNote
into something likeetc.