Skip to content

Commit

Permalink
fix: unable to add a comment using # in codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tiensonqin committed Dec 15, 2024
1 parent 1f86f47 commit 277096d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion deps/outliner/src/logseq/outliner/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@
eid (or db-id (when block-uuid [:block/uuid block-uuid]))
block-entity (d/entity db eid)
page? (ldb/page? block-entity)
m* (if (and db-based? (:block/title m*))
m* (if (and db-based? (:block/title m*)
(not (:logseq.property.node/display-type block-entity)))
(update m* :block/title common-util/clear-markdown-heading)
m*)
block-title (:block/title m*)
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/format/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ and handles unexpected failure."
(let [block (dissoc block :block/pre-block?)
format (or format :markdown)
parse-config (mldoc/get-default-config format)
ast (format/to-edn title format parse-config)
;; Disable extraction for display-type blocks as there isn't a reason to have
;; it enabled yet and can cause visible bugs when '#' is used
blocks (if (and (config/db-based-graph? (state/get-current-repo))
(:logseq.property.node/display-type block))
[block]
(extract-blocks ast title format {:parse-block block}))
(let [ast (format/to-edn title format parse-config)]
(extract-blocks ast title format {:parse-block block})))
new-block (first blocks)
block (cond->
(merge block new-block)
Expand Down

0 comments on commit 277096d

Please sign in to comment.