mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 13:14:39 +00:00
fix(export): replace page-ref-id with its block/title
This commit is contained in:
@@ -4,19 +4,19 @@
|
||||
when use together with dynamic var."
|
||||
(:refer-clojure :exclude [map filter mapcat concat remove])
|
||||
(:require [cljs.core.match :refer [match]]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.string :as string]
|
||||
[frontend.db :as db]
|
||||
[frontend.format.mldoc :as mldoc]
|
||||
[frontend.modules.file.core :as outliner-file]
|
||||
[frontend.modules.outliner.tree :as outliner-tree]
|
||||
[frontend.persist-db.browser :as db-browser]
|
||||
[frontend.state :as state]
|
||||
[frontend.util :as util :refer [concatv mapcatv removev]]
|
||||
[frontend.worker.export :as worker-export]
|
||||
[malli.core :as m]
|
||||
[malli.util :as mu]
|
||||
[promesa.core :as p]
|
||||
[frontend.persist-db.browser :as db-browser]
|
||||
[frontend.worker.export :as worker-export]
|
||||
[clojure.edn :as edn]))
|
||||
[promesa.core :as p]))
|
||||
|
||||
;;; TODO: split frontend.handler.export.text related states
|
||||
(def ^:dynamic *state*
|
||||
@@ -59,10 +59,9 @@
|
||||
(defn- get-blocks-contents
|
||||
[repo root-block-uuid & {:keys [init-level]
|
||||
:or {init-level 1}}]
|
||||
(->
|
||||
(db/get-block-and-children repo root-block-uuid)
|
||||
(outliner-tree/blocks->vec-tree (str root-block-uuid))
|
||||
(outliner-file/tree->file-content {:init-level init-level})))
|
||||
(-> (db/pull-many (keep :db/id (db/get-block-and-children repo root-block-uuid)))
|
||||
(outliner-tree/blocks->vec-tree (str root-block-uuid))
|
||||
(outliner-file/tree->file-content {:init-level init-level})))
|
||||
|
||||
(defn root-block-uuids->content
|
||||
[repo root-block-uuids]
|
||||
@@ -522,7 +521,6 @@
|
||||
[[tp _]]
|
||||
(= tp "Properties"))
|
||||
|
||||
|
||||
(defn replace-Heading-with-Paragraph
|
||||
"works on block-ast
|
||||
replace all heading with paragraph when indent-style is no-indent"
|
||||
@@ -561,7 +559,6 @@
|
||||
:result-ast-tcoll
|
||||
persistent!))
|
||||
|
||||
|
||||
;;; inline transformers
|
||||
|
||||
(defn remove-emphasis
|
||||
@@ -585,6 +582,9 @@
|
||||
(if (and (= "Page_ref" (first url))
|
||||
(or (empty? label)
|
||||
(= label [["Plain" ""]])))
|
||||
;; (let [plain-text (second url)]
|
||||
;; (if (db-content/))
|
||||
;; )
|
||||
["Plain" (second url)]
|
||||
inline-ast))
|
||||
;; else
|
||||
@@ -823,11 +823,9 @@
|
||||
|
||||
;;; simple ast (ends)
|
||||
|
||||
|
||||
;;; TODO: walk the hiccup tree,
|
||||
;;; and call escape-html on all its contents
|
||||
;;;
|
||||
|
||||
|
||||
;;; walk the hiccup tree,
|
||||
;;; and call escape-html on all its contents (ends)
|
||||
|
||||
Reference in New Issue
Block a user