Fix vCard folding and group parsing rules

Accept horizontal-tab continuations when unfolding content lines and
allow hyphens in group names, matching the MIME-DIR and vCard grammar.
Also add focused private tests covering both cases.

AI-Assisted: yes
AI-Tool: OpenAI Codex / gpt-5.4 xhigh
This commit is contained in:
2026-03-28 10:04:44 -05:00
parent 3d2d40667d
commit 466e47fd36
3 changed files with 17 additions and 2 deletions

View File

@@ -163,8 +163,9 @@ proc readGroup*(p: var VCardParser): Option[string] =
## name. If there is not a valid group the read position is left unchanged.
p.setBookmark
let validChars = ALPHA_NUM + {'-'}
var ch = p.read
while ALPHA_NUM.contains(ch): ch = p.read
while validChars.contains(ch): ch = p.read
if (ch == '.'):
result = some(readSinceBookmark(p)[0..^2])