-
-
Save gdchamal/43c58f9d581cee05c40706692f852373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tao~/dev/caliopen/go/src/github.com/emersion/go-vcard(master|✚1) % git diff | |
diff --git a/decoder.go b/decoder.go | |
index 1d2153d..37356b9 100644 | |
--- a/decoder.go | |
+++ b/decoder.go | |
@@ -108,14 +108,19 @@ func parseLine(l string) (key string, field *Field, err error) { | |
if err != nil { | |
return | |
} | |
- | |
if hasParams { | |
- field.Params, l, err = parseParams(l) | |
+ i := strings.IndexAny(l, "=") | |
+ if i >= 0 { | |
+ field.Params, l, err = parseParams(l) | |
+ } else { | |
+ // Surely v2.1 parameter syntax | |
+ i = strings.IndexAny(l, ":") | |
+ l = l[i+1:] | |
+ } | |
if err != nil { | |
return | |
} | |
} | |
- | |
field.Value = parseValue(l) | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
INFO[0000] Found 4 vcards
INFO[0000] Vcard wit fn Emma
INFO[0000] Got contact emma@tomme.de.savoie
I parse correctly this