openpgpjs/openpgpjs — pull request #225 by toberndo (2014-05-16 17:20:24+00:00)
Title: Redefine Regex for blank line after armor header

This fixes an issue with truncated blank lines at the beginning of cleartext signed messages.
Fixes https://github.com/openpgpjs/openpgpjs/issues/209

We have to deal with all sorts of whitespace characters in armored messages, see also https://github.com/openpgpjs/openpgpjs/issues/193

The previously used regex to split the armor header `/^\s*\n/m` did also include multiple consecutive newline.

The new one splits only at a blank line with whitespace characters:

`/^[ \f\r\t\u00a0\u2000-\u200a\u202f\u205f\u3000]*\n/m`

I took the definition of `\s` from https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions

```
Matches a single white space character, including space, tab, form feed, line feed.
Equivalent to [ \f\n\r\t\v​\u00a0\u1680​\u180e\u2000​\u2001\u2002​\u2003\u2004​\u2005
\u2006​\u2007\u2008​\u2009\u200a​\u2028\u2029​​\u202f\u205f​\u3000].
```

But removed `\v\u1680​\u180e\u2028\u2029` as they gave non-whitespace characters on either Chrome, Firefox, IE9 or Safari 5.