diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-01 02:37:42 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-01 02:37:42 +0100 |
commit | 049e94a125ecf43547b62778eb4851d67b1f3cfd (patch) | |
tree | e19ec167bdad91baa8953b8230341e55ad1c51b9 | |
parent | Remove no longer relevant TODO about set-config! (diff) | |
download | calp-049e94a125ecf43547b62778eb4851d67b1f3cfd.tar.gz calp-049e94a125ecf43547b62778eb4851d67b1f3cfd.tar.xz |
Resolve remaining TODO:s in config.scm.
-rw-r--r-- | config.scm | 20 |
1 files changed, 8 insertions, 12 deletions
@@ -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 "<div> " str "</div>") - 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+")) |