-
Notifications
You must be signed in to change notification settings - Fork 35
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 to support parsing of "quoted-printable" encoded property values #31
Conversation
e.g. needed for "quoted-printable" encoded values
The lines of the
|
@mlandes with what did you run into this issue? Is it a specific program / platform / whatever that outputs QP encoded notes like that? |
I use a webservice by ABBYY for OCR of business cards, which outputs vcards with a Quoted-Printable encoded note property in this form:
According to RFC this is correct syntax, because only a combination of \r\n (CRLF) is a correct property delimiter and folding is defined as:
See: https://tools.ietf.org/html/rfc6350#section-3.2 In Quoted-Printable encoding a separate sequence of |
I see – the formatting of the examples in your initial comment tripped me up there. Would you mind adding a test to go along with this, so we don't break it again in the future? |
done |
Neat, thanks! |
Published in |
@@ -31,6 +32,12 @@ suite( 'vCard', function() { | |||
assert.deepEqual( card.get( 'tel' ).type, [ 'voice', 'home' ] ) | |||
}) | |||
|
|||
test( 'should parse vCard property values containing isolated \\n without delimiting, e.g. used in quoted-printable encoding (issue #31)', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, no worries – issue and PR numbers don't overlap on GitHub, so it'll be found :)
Hi again, Therefore I had to use a small workaround to support these "common-law" vcards:
Maybe this should be added in your module so that this pullrequest does not break these often used but wrongly generated vcards. |
Well, that's why the line-splitting regex was Thinking about it though, it'll be best to stick to the specifications. Supporting LF only vcards would also break support for QP encoded newlines. And users can still work around this by replacing LF with CRLF in their input should they need to parse malformed vcf data. |
Example of valid vcard property:
With "visible" EOL characters ...:
... or as string: