From 049e94a125ecf43547b62778eb4851d67b1f3cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 1 Mar 2022 02:37:42 +0100 Subject: Resolve remaining TODO:s in config.scm. --- config.scm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'config.scm') diff --git a/config.scm b/config.scm index 48363d26..e03cef0b 100644 --- a/config.scm +++ b/config.scm @@ -8,7 +8,6 @@ (set-config! 'calendar-files (glob "~/.local/var/cal/*")) -;;; TODO possibly replace with propper lookup (define my-courses '((TSEA82 . "Datorteknik") (TFYA19 . "Kvantdatorer") @@ -30,17 +29,14 @@ (define (a link) `(a (@ (href ,link)) ,link)) (define (parse-html str) - ;; extra space to ensure that we don't get a self closing - ;; div tag in the final output - ;; TODO Fix a real sxml->html | The space - ;; method instead of pretending | - ;; that HTML is XML. v - (xml->sxml (string-append "
" str "
") - default-entity-handler: - (lambda (port name) - (case name - [(nbsp) " "] - [else (symbol->string name)]))) ) + (catch 'misc-error + (lambda () + ;; resolve interface throws on missing module + (let* ((gumbo (resolve-interface '(sxml gumbo))) + (html->sxml (module-ref gumbo 'html->sxml))) + (html->sxml str))) + ;; Give up on parsing + (lambda _ str))) (define (parse-links str) (define regexp (make-regexp "https?://\\S+")) -- cgit v1.2.3