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

@@ -1272,6 +1272,13 @@ proc runVCard3PrivateTests*() =
assert g.isSome
assert g.get == "mygroup"
# "readGroup with hyphen":
block:
var p = initParser("item-1.BEGIN:VCARD")
let g = p.readGroup
assert g.isSome
assert g.get == "item-1"
# "readGroup without group":
block:
var p = initParser("BEGIN:VCARD")