fix(users/sterni/mblog): use string-equal where casing is irrelevant

Change-Id: Ic1303a04de005977a552eba38aa13d512d2c20e2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5071
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
sterni 2022-01-12 18:58:21 +01:00
parent 7577a89284
commit f7d7da6ace
2 changed files with 10 additions and 10 deletions

View file

@ -23,8 +23,8 @@
to determine if a given mime message is an Apple Note."
(when-let (uniform-id (assoc "X-Uniform-Type-Identifier"
(mime:mime-message-headers msg)
:test #'string=))
(string= (cdr uniform-id) "com.apple.mail-note")))
:test #'string-equal))
(string-equal (cdr uniform-id) "com.apple.mail-note")))
(defun apple-note-html-fragment (msg out)
"Takes a MIME:MIME-MESSAGE and writes its text content as HTML to
@ -42,10 +42,10 @@
((not text) (error "Malformed Apple Note: no text part"))
;; notemap creates text/plain notes we need to handle properly.
;; Additionally we *could* check X-Mailer which notemap sets
((string= (mime:mime-subtype text) "plain")
((string-equal (mime:mime-subtype text) "plain")
(html-escape-stream (mime:mime-body-stream text :binary nil) out))
;; Notes.app creates text/html parts
((string= (mime:mime-subtype text) "html")
((string-equal (mime:mime-subtype text) "html")
(closure-html:parse
(mime:mime-body-stream text)
(make-instance

View file

@ -60,7 +60,7 @@
(defun parse-content-id (attrlist)
(when-let (data (find-if (lambda (x)
(string= (hax:attribute-name x) "DATA"))
(string-equal (hax:attribute-name x) "DATA"))
attrlist))
(multiple-value-bind (starts-with-cid-p suffix)
(starts-with-subseq "cid:" (hax:attribute-value data)
@ -81,16 +81,16 @@
;; If we are not discarding any outer elements, we can set
;; up a new discard condition if we encounter an appropriate
;; element.
((member name +discard-tags-with-children+ :test #'string=)
((member name +discard-tags-with-children+ :test #'string-equal)
(setf discard-until (cons name depth)))
;; Only drop this event, must be mirrored in END-ELEMENT to
;; avoid invalidly nested HTML.
((member name +discard-tags-only+ :test #'string=) nil)
((member name +discard-tags-only+ :test #'string-equal) nil)
;; If we encounter an object tag, we drop it and its contents,
;; but only after inspecting its attributes and emitting new
;; events representing an img tag which includes the respective
;; attachment via its filename.
((string= name "OBJECT")
((string-equal name "OBJECT")
(progn
(setf discard-until (cons "OBJECT" depth))
;; TODO(sterni): check type and only resolve images, raise error
@ -116,12 +116,12 @@
;; If we are discarding and encounter the same tag again at the same
;; depth, we can stop, but still have to discard the current tag.
((and discard-until
(string= (car discard-until) name)
(string-equal (car discard-until) name)
(= (cdr discard-until) depth))
(setf discard-until nil))
;; In all other cases, we drop properly.
(discard-until nil)
;; Mirrored tag stripping as in START-ELEMENT
((member name +discard-tags-only+ :test #'string=) nil)
((member name +discard-tags-only+ :test #'string-equal) nil)
;; In all other cases, we use HAX-PROXY-HANDLER to pass the event on.
(t (call-next-method)))))