Skip to content

Commit

Permalink
fix: order is lost when there are more than 8 property:: in a block
Browse files Browse the repository at this point in the history
related to logseq#3923
  • Loading branch information
tiensonqin committed Mar 8, 2022
1 parent 4c777fc commit 90ef703
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/main/frontend/format/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@
(defn page-name->map
"Create a page's map structure given a original page name (string).
map as input is supported for legacy compatibility.
with-timestamp?: assign timestampes to the map structure.
Useful when creating new pages from references or namespaces,
with-timestamp?: assign timestampes to the map structure.
Useful when creating new pages from references or namespaces,
as there's no chance to introduce timestamps via editing in page"
([original-page-name with-id?]
(page-name->map original-page-name with-id? true))
Expand Down Expand Up @@ -474,17 +474,18 @@
(cons
(merge
(let [content (utf8/substring encoded-content 0 first-block-start-pos)
id (get-custom-id-or-new-id {:properties @pre-block-properties})
property-refs (->> (get-page-refs-from-properties @pre-block-properties)
{:keys [properties properties-order]} @pre-block-properties
id (get-custom-id-or-new-id {:properties properties})
property-refs (->> (get-page-refs-from-properties properties)
(map :block/original-name))
block {:uuid id
:content content
:level 1
:meta {:start-pos 0
:end-pos (or first-block-start-pos
(utf8/length encoded-content))}
:properties @pre-block-properties
:properties-order (keys @pre-block-properties)
:properties properties
:properties-order properties-order
:refs property-refs
:pre-block? true
:unordered true
Expand Down Expand Up @@ -601,8 +602,7 @@
(conj body block))))
(do
(when (seq properties)
(let [properties (:properties properties)]
(reset! pre-block-properties properties)))
(reset! pre-block-properties properties))
[(-> (reverse headings)
safe-blocks) body])))]
(extract-blocks* blocks body pre-block-properties encoded-content with-body?))
Expand Down

0 comments on commit 90ef703

Please sign in to comment.