mirror of
https://github.com/logseq/logseq.git
synced 2026-05-02 01:46:35 +00:00
improve(pdf): friendly breakline for multiple language highlights text
This commit is contained in:
@@ -161,11 +161,12 @@
|
||||
[text]
|
||||
|
||||
(when-not (string/blank? text)
|
||||
(let [sp "@#~#@"]
|
||||
(let [sp "|#|"]
|
||||
(-> text
|
||||
(string/replace #"[\r\n]+" sp)
|
||||
(string/replace (str "-" sp) "")
|
||||
(string/replace sp " ")))))
|
||||
(string/replace #"\|#\|([a-zA-Z_])" " $1")
|
||||
(string/replace sp "")))))
|
||||
|
||||
;; TODO: which viewer instance?
|
||||
(defn next-page
|
||||
@@ -179,3 +180,10 @@
|
||||
(try
|
||||
(js-invoke js/window.lsPdfViewer "previousPage")
|
||||
(catch js/Error _e nil)))
|
||||
|
||||
(comment
|
||||
(fix-selection-text-breakline "this is a\ntest paragraph")
|
||||
(fix-selection-text-breakline "he is 1\n8 years old")
|
||||
(fix-selection-text-breakline "这是一个\n\n段落")
|
||||
(fix-selection-text-breakline "これ\n\nは、段落")
|
||||
(fix-selection-text-breakline "this is a te-\nst paragraph"))
|
||||
Reference in New Issue
Block a user