Enhance/PDF viewer (#7369)

* fix(pdf): WIP potential memory leaks
* enhance(pdf): sync page number in highlights metafile
* enhance(pdf): support preview highlight area image in a lightbox
* fix: clojurescript unit tests
* fix(pdf): page number overflow when more digits
This commit is contained in:
Charlie
2022-11-17 20:31:08 +08:00
committed by GitHub
parent a6f6b0abae
commit dd2ef163ba
12 changed files with 208 additions and 115 deletions

View File

@@ -173,6 +173,20 @@
(string/replace #"\|#\|([a-zA-Z_])" " $1")
(string/replace sp "")))))
(defn fix-local-asset-pagename
[filename]
(when-not (string/blank? filename)
(let [local-asset? (re-find #"[0-9]{13}_\d$" filename)
hls? (re-find #"^hls__" filename)
len (count filename)]
(if (or local-asset? hls?)
(-> filename
(subs 0 (if local-asset? (- len 15) len))
(string/replace #"^hls__" "")
(string/replace "_" " ")
(string/trimr))
filename))))
;; TODO: which viewer instance?
(defn next-page
[]