Skip to content

Commit

Permalink
imp - Trim prefixes for properties
Browse files Browse the repository at this point in the history
---

We've improved support for whitespaces for property prefixes

---

Type: imp
Breaking: False
Doc Required: False
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Oct 9, 2024
1 parent afd87bd commit afa9818
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VisualCard.ShowContacts/TestFiles/fourVCard4.vcf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ADR;TYPE=home:;;Street Address;;;;
EMAIL;TYPE=HOME:neville.nvs@gmail.com
EMAIL;TYPE=WORK:neville.nvs@nvsc.com
FN:Neville Navasquillo
IMPP;TYPE=HOME:aim:IM
A.IMPP;TYPE=HOME:aim:IM
IMPP;TYPE=HOME:msn:Windows LIVE
IMPP;TYPE=HOME:ymsgr:Yahoo
N;ALTID=0;LANGUAGE=en:Navasquillo;Neville;Neville\,Nevile;Mr.;Jr.
Expand Down
4 changes: 2 additions & 2 deletions VisualCard/Parsers/Arguments/PropertyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ internal PropertyInfo(string line)
line = line.Trim();
string value = line.Substring(line.IndexOf(VcardConstants._argumentDelimiter) + 1).Trim();
string prefixWithArgs = line.Substring(0, line.IndexOf(VcardConstants._argumentDelimiter)).Trim();
string prefix = (prefixWithArgs.Contains($"{VcardConstants._fieldDelimiter}") ? prefixWithArgs.Substring(0, prefixWithArgs.IndexOf($"{VcardConstants._fieldDelimiter}")) : prefixWithArgs).ToUpper();
string prefix = (prefixWithArgs.Contains($"{VcardConstants._fieldDelimiter}") ? prefixWithArgs.Substring(0, prefixWithArgs.IndexOf($"{VcardConstants._fieldDelimiter}")) : prefixWithArgs).Trim().ToUpper();
string args = prefixWithArgs.Contains($"{VcardConstants._fieldDelimiter}") ? prefixWithArgs.Substring(prefix.Length + 1) : "";
string[] splitArgs = args.Split([VcardConstants._fieldDelimiter], StringSplitOptions.RemoveEmptyEntries);
var finalArgs = splitArgs.Select((arg) => new ArgumentInfo(arg)).ToArray();
Expand All @@ -136,7 +136,7 @@ internal PropertyInfo(string line)
this.rawValue = value;
this.prefix = prefix;
this.arguments = finalArgs;
this.group = group;
this.group = group.Trim();
}
}
}

0 comments on commit afa9818

Please sign in to comment.