aboutsummaryrefslogtreecommitdiff
path: root/config.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-04-25 00:53:45 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-04-25 00:53:45 +0200
commitc5922e36034eeff11697643e37c26a16e7cce298 (patch)
treea8e94154463c1c31509f35d104e7eab7ad92a3b6 /config.scm
parentChange user-additions HTML detection. (diff)
downloadcalp-c5922e36034eeff11697643e37c26a16e7cce298.tar.gz
calp-c5922e36034eeff11697643e37c26a16e7cce298.tar.xz
Scheme and js now finds HTML in text with same regex.
Diffstat (limited to 'config.scm')
-rw-r--r--config.scm13
1 files changed, 5 insertions, 8 deletions
diff --git a/config.scm b/config.scm
index 04b63b71..c0e4e639 100644
--- a/config.scm
+++ b/config.scm
@@ -84,18 +84,15 @@
[else (list line '(br))])))
(string-split str #\newline)))
-(define html-cals
- '("D-sektionens officiella kalender"
- "LiTHe kod"
- "Klassfadder 2020"))
+(define html-rx
+ (make-regexp "</?\\w+( +\\w+(=[\"']?\\w+[\"']?)?)* */?>"))
((@ (calp html filter) description-filter)
(lambda (ev str)
- (cond [(member (prop (parent ev) 'NAME)
- html-cals)
- (parse-html str)]
- [(prop ev 'X-MICROSOFT-SKYPETEAMSMEETINGURL)
+ (cond [(prop ev 'X-MICROSOFT-SKYPETEAMSMEETINGURL)
(parse-teams-description str)]
+ [(regexp-exec html-rx str)
+ (parse-html str)]
[else (parse-links str)])))
((@ (datetime) week-start) mon)