aboutsummaryrefslogtreecommitdiff
path: root/config.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-01 02:37:42 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-01 02:37:42 +0100
commit049e94a125ecf43547b62778eb4851d67b1f3cfd (patch)
treee19ec167bdad91baa8953b8230341e55ad1c51b9 /config.scm
parentRemove no longer relevant TODO about set-config! (diff)
downloadcalp-049e94a125ecf43547b62778eb4851d67b1f3cfd.tar.gz
calp-049e94a125ecf43547b62778eb4851d67b1f3cfd.tar.xz
Resolve remaining TODO:s in config.scm.
Diffstat (limited to 'config.scm')
-rw-r--r--config.scm20
1 files changed, 8 insertions, 12 deletions
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 "<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+"))