mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
Fix contents for markdown
This commit is contained in:
@@ -116,6 +116,9 @@
|
||||
edit-id)
|
||||
(when (string/ends-with? (:heading/content first-heading) "[[]]" )
|
||||
(js/setTimeout #(util/cursor-move-back (gdom/getElement edit-id) 2)
|
||||
50))
|
||||
(when (string/ends-with? (:heading/content first-heading) "[[]]\n---" )
|
||||
(js/setTimeout #(util/cursor-move-back (gdom/getElement edit-id) 6)
|
||||
50))))))
|
||||
state)
|
||||
:did-update handler/scroll-and-highlight!}
|
||||
|
||||
@@ -733,8 +733,8 @@
|
||||
(let [alias-ids (get-page-alias repo page-name)]
|
||||
(when (seq alias-ids)
|
||||
(->> (d/pull-many (get-conn repo)
|
||||
'[:page/name]
|
||||
alias-ids)
|
||||
'[:page/name]
|
||||
alias-ids)
|
||||
(map :page/name)
|
||||
distinct))))
|
||||
|
||||
@@ -986,16 +986,17 @@
|
||||
(let [page (string/lower-case page)
|
||||
page-id (:db/id (entity repo-url [:page/name page]))
|
||||
db (get-conn repo-url)]
|
||||
(some->
|
||||
(q repo-url [:page/headings page-id]
|
||||
{:use-cache? true
|
||||
:transform-fn #(page-headings-transform repo-url %)
|
||||
:query-fn (fn [db]
|
||||
(let [datoms (d/datoms db :avet :heading/page page-id)
|
||||
heading-eids (mapv :e datoms)]
|
||||
(d/pull-many db '[*] heading-eids)))}
|
||||
nil)
|
||||
react))))
|
||||
(when page-id
|
||||
(some->
|
||||
(q repo-url [:page/headings page-id]
|
||||
{:use-cache? true
|
||||
:transform-fn #(page-headings-transform repo-url %)
|
||||
:query-fn (fn [db]
|
||||
(let [datoms (d/datoms db :avet :heading/page page-id)
|
||||
heading-eids (mapv :e datoms)]
|
||||
(d/pull-many db '[*] heading-eids)))}
|
||||
nil)
|
||||
react)))))
|
||||
|
||||
(defn get-page-directives-content
|
||||
[page]
|
||||
|
||||
@@ -947,7 +947,7 @@
|
||||
(util/format "#+TITLE: %s\n#+TAGS:\n\n** " title))
|
||||
"markdown"
|
||||
(if contents?
|
||||
(util/format "---\ntitle: %s\nlist: [[]]" title)
|
||||
(util/format "---\ntitle: %s\nlist: [[]]\n---" title)
|
||||
(util/format "---\ntitle: %s\ntags:\n---\n\n## " title))
|
||||
"")))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user