diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/output/ical.scm | 10 | ||||
-rw-r--r-- | module/util.scm | 4 | ||||
-rw-r--r-- | module/vcomponent/parse/component.scm | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/module/output/ical.scm b/module/output/ical.scm index 02dd5d64..fd4091ed 100644 --- a/module/output/ical.scm +++ b/module/output/ical.scm @@ -97,6 +97,11 @@ (ical-line-fold (string-drop string wrap-len)))] [else string])) +(define* (internal-field? symbol optional: (prefix "X-HNH-")) + (string=? prefix + (string-take-to (symbol->string symbol) + (string-length prefix)))) + (define-public (component->ical-string component) (format #t "BEGIN:~a\r\n" (type component)) ;; TODO this leaks internal information, @@ -105,11 +110,8 @@ ;; Special cases depending on key. ;; Value formatting is handled in @code{value-format}. (match-lambda* - ;; Handled below - [('X-HNH-ALTERNATIVES _) 'noop] - ;; Remove from output - [('X-HNH-FILENAME _) 'noop] + [(? (compose internal-field? car)) 'noop] [(key (vlines ...)) (for vline in vlines diff --git a/module/util.scm b/module/util.scm index b168ffc4..f41877b5 100644 --- a/module/util.scm +++ b/module/util.scm @@ -316,6 +316,10 @@ (if (> i (length lst)) lst (take lst i))) +(define-public (string-take-to str i) + (if (> i (string-length str)) + str (string-take str i))) + (define-public (as-string s) (if (symbol? s) (symbol->string s) s)) diff --git a/module/vcomponent/parse/component.scm b/module/vcomponent/parse/component.scm index 8526944a..d54f977a 100644 --- a/module/vcomponent/parse/component.scm +++ b/module/vcomponent/parse/component.scm @@ -62,7 +62,7 @@ (let ((datetime (parse-ics-datetime value tz))) (hashq-set! params 'VALUE 'DATE-TIME) (values (make-vline key (get-datetime datetime) params) - (make-vline (symbol-append 'X-ORIGINAL- key) datetime params))) + (make-vline (symbol-append 'X-HNH-ORIGINAL- key) datetime params))) (begin (hashq-set! params 'VALUE 'DATE) (make-vline key (parse-ics-date value) params)))))] |