|
|
@@ -61,12 +61,12 @@
|
|
|
page (get-page-name file ast)
|
|
|
[page page-name journal-day] (block/convert-page-if-journal page)
|
|
|
blocks (->> (block/extract-blocks ast content false format)
|
|
|
- (block/with-parent-and-left {:block/name (string/lower-case page)}))
|
|
|
+ (block/with-parent-and-left {:block/name page-name}))
|
|
|
ref-pages (atom #{})
|
|
|
ref-tags (atom #{})
|
|
|
blocks (map (fn [block]
|
|
|
(let [block-ref-pages (seq (:block/refs block))
|
|
|
- page-lookup-ref [:block/name (string/lower-case page)]
|
|
|
+ page-lookup-ref [:block/name page-name]
|
|
|
block-path-ref-pages (->> (cons page-lookup-ref (seq (:block/path-refs block)))
|
|
|
(remove nil?))]
|
|
|
(when block-ref-pages
|
|
|
@@ -74,7 +74,7 @@
|
|
|
(-> block
|
|
|
(dissoc :ref-pages)
|
|
|
(assoc :block/format format
|
|
|
- :block/page [:block/name (string/lower-case page)]
|
|
|
+ :block/page [:block/name page-name]
|
|
|
:block/refs block-ref-pages
|
|
|
:block/path-refs block-path-ref-pages))))
|
|
|
blocks)
|
|
|
@@ -96,7 +96,8 @@
|
|
|
(assoc :block/alias
|
|
|
(map
|
|
|
(fn [alias]
|
|
|
- (let [page-name (string/lower-case alias)
|
|
|
+ (let [alias (util/page-name-sanity alias)
|
|
|
+ page-name (string/lower-case alias)
|
|
|
aliases (distinct
|
|
|
(conj
|
|
|
(remove #{alias} aliases)
|
|
|
@@ -117,7 +118,7 @@
|
|
|
tags (if (string? tags) [tags] tags)
|
|
|
tags (remove string/blank? tags)]
|
|
|
(swap! ref-tags set/union (set tags))
|
|
|
- (map (fn [tag] {:block/name (string/lower-case tag)
|
|
|
+ (map (fn [tag] {:block/name (util/page-name-sanity (string/lower-case tag))
|
|
|
:block/original-name tag})
|
|
|
tags)))))
|
|
|
pages (->> (concat
|
|
|
@@ -126,7 +127,7 @@
|
|
|
(map
|
|
|
(fn [page]
|
|
|
{:block/original-name page
|
|
|
- :block/name (string/lower-case page)})
|
|
|
+ :block/name (util/page-name-sanity (string/lower-case page))})
|
|
|
@ref-tags))
|
|
|
;; remove block references
|
|
|
(remove vector?))
|