working on vcard display

This commit is contained in:
2025-10-07 21:47:49 +02:00
parent 3e8c3f1d3a
commit f6a8734614
9 changed files with 66 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
export function addr(vcard){
const match = vcard.match(/^ADR:(.+)$/m);
const match = vcard.match(/^ADR.*:(.+)$/m);
let adr = {
box: null,
ext: null,
@@ -22,9 +22,18 @@ export function addr(vcard){
return adr;
}
export function email(vcard){
const match = vcard.match(/^EMAIL.*:(.+)$/m);
return match ? match[1].trim() : '';
}
export function extra(code){
const match = code.match(/^X-(.+):(.+)/)
return match ? {name:match[1],value:match[2]} : null
}
export function fn(vcard){
const match = vcard.match(/^FN:(.+)$/m);
const match = vcard.match(/^FN.*:(.+)$/m);
return match ? match[1].trim() : '';
}