-
Notifications
You must be signed in to change notification settings - Fork 795
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
Split armor at empty line #209
Comments
/^\s*?\n/m; has the same effect as the existing code so it won't work. The other three that I gave should all work. ----- Original Message ----- | From: "Thomas Oberndörfer" notifications@github.com | The empty line that separates armor header from body can contain whitespace-y | Currently we split at: /^\s*\n/m; | Suggestions: | /^\s_?\n/m; | — |
I checked:
And it doesn't replace other whitespace characters. So I think |
@Robert-Nelson how about |
I think that would work but is overly complex with the multiple negatives. I think the simplest is: /^[ \t]*\n/m I remember now why I used the "m" modifier, I wanted the trailing \n included in the match, so some of my other suggestions earlier weren't right. ----- Original Message ----- | From: "Thomas Oberndörfer" notifications@github.com | @Robert-Nelson how about /^[^\S\n]*\n/m; from | — |
Ah, forgot about damn unicode, in that case go with your suggestion. ----- Original Message ----- | From: "Thomas Oberndörfer" notifications@github.com | I checked: | And it doesn't replace other whitespace characters. | So I think /^[\t ]\n/m; would only filer out spaces (0x20) and tabs but not | — |
Btw RFC 4880 says empty line so I'm not sure that technically any whitespace chars are valid. :-) ----- Original Message ----- | From: "Robert B. Nelson" robertn@the-nelsons.org | Ah, forgot about damn unicode, in that case go with your suggestion. | ----- Original Message ----- | | From: "Thomas Oberndörfer" notifications@github.com | | I checked: | | And it doesn't replace other whitespace characters. | | So I think /^[\t ]\n/m; would only filer out spaces (0x20) and tabs but not | | — |
Created pull request for this issue: #225 |
The empty line that separates armor header from body can contain whitespace-y characters. See #193
Currently we split at: /^\s*\n/m;
Suggestions:
/^\s_?\n/m;
/^[\t ]\n/m;
/^[\t ]$/;
/^\s_$/;
The text was updated successfully, but these errors were encountered: