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:
parent
7577a89284
commit
f7d7da6ace
2 changed files with 10 additions and 10 deletions
|
|
@ -23,8 +23,8 @@
|
||||||
to determine if a given mime message is an Apple Note."
|
to determine if a given mime message is an Apple Note."
|
||||||
(when-let (uniform-id (assoc "X-Uniform-Type-Identifier"
|
(when-let (uniform-id (assoc "X-Uniform-Type-Identifier"
|
||||||
(mime:mime-message-headers msg)
|
(mime:mime-message-headers msg)
|
||||||
:test #'string=))
|
:test #'string-equal))
|
||||||
(string= (cdr uniform-id) "com.apple.mail-note")))
|
(string-equal (cdr uniform-id) "com.apple.mail-note")))
|
||||||
|
|
||||||
(defun apple-note-html-fragment (msg out)
|
(defun apple-note-html-fragment (msg out)
|
||||||
"Takes a MIME:MIME-MESSAGE and writes its text content as HTML to
|
"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"))
|
((not text) (error "Malformed Apple Note: no text part"))
|
||||||
;; notemap creates text/plain notes we need to handle properly.
|
;; notemap creates text/plain notes we need to handle properly.
|
||||||
;; Additionally we *could* check X-Mailer which notemap sets
|
;; 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))
|
(html-escape-stream (mime:mime-body-stream text :binary nil) out))
|
||||||
;; Notes.app creates text/html parts
|
;; Notes.app creates text/html parts
|
||||||
((string= (mime:mime-subtype text) "html")
|
((string-equal (mime:mime-subtype text) "html")
|
||||||
(closure-html:parse
|
(closure-html:parse
|
||||||
(mime:mime-body-stream text)
|
(mime:mime-body-stream text)
|
||||||
(make-instance
|
(make-instance
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
|
|
||||||
(defun parse-content-id (attrlist)
|
(defun parse-content-id (attrlist)
|
||||||
(when-let (data (find-if (lambda (x)
|
(when-let (data (find-if (lambda (x)
|
||||||
(string= (hax:attribute-name x) "DATA"))
|
(string-equal (hax:attribute-name x) "DATA"))
|
||||||
attrlist))
|
attrlist))
|
||||||
(multiple-value-bind (starts-with-cid-p suffix)
|
(multiple-value-bind (starts-with-cid-p suffix)
|
||||||
(starts-with-subseq "cid:" (hax:attribute-value data)
|
(starts-with-subseq "cid:" (hax:attribute-value data)
|
||||||
|
|
@ -81,16 +81,16 @@
|
||||||
;; If we are not discarding any outer elements, we can set
|
;; If we are not discarding any outer elements, we can set
|
||||||
;; up a new discard condition if we encounter an appropriate
|
;; up a new discard condition if we encounter an appropriate
|
||||||
;; element.
|
;; element.
|
||||||
((member name +discard-tags-with-children+ :test #'string=)
|
((member name +discard-tags-with-children+ :test #'string-equal)
|
||||||
(setf discard-until (cons name depth)))
|
(setf discard-until (cons name depth)))
|
||||||
;; Only drop this event, must be mirrored in END-ELEMENT to
|
;; Only drop this event, must be mirrored in END-ELEMENT to
|
||||||
;; avoid invalidly nested HTML.
|
;; 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,
|
;; If we encounter an object tag, we drop it and its contents,
|
||||||
;; but only after inspecting its attributes and emitting new
|
;; but only after inspecting its attributes and emitting new
|
||||||
;; events representing an img tag which includes the respective
|
;; events representing an img tag which includes the respective
|
||||||
;; attachment via its filename.
|
;; attachment via its filename.
|
||||||
((string= name "OBJECT")
|
((string-equal name "OBJECT")
|
||||||
(progn
|
(progn
|
||||||
(setf discard-until (cons "OBJECT" depth))
|
(setf discard-until (cons "OBJECT" depth))
|
||||||
;; TODO(sterni): check type and only resolve images, raise error
|
;; 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
|
;; 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.
|
;; depth, we can stop, but still have to discard the current tag.
|
||||||
((and discard-until
|
((and discard-until
|
||||||
(string= (car discard-until) name)
|
(string-equal (car discard-until) name)
|
||||||
(= (cdr discard-until) depth))
|
(= (cdr discard-until) depth))
|
||||||
(setf discard-until nil))
|
(setf discard-until nil))
|
||||||
;; In all other cases, we drop properly.
|
;; In all other cases, we drop properly.
|
||||||
(discard-until nil)
|
(discard-until nil)
|
||||||
;; Mirrored tag stripping as in START-ELEMENT
|
;; 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.
|
;; In all other cases, we use HAX-PROXY-HANDLER to pass the event on.
|
||||||
(t (call-next-method)))))
|
(t (call-next-method)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue