Skip to content

Commit

Permalink
fix heading case logically incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
megayu committed Mar 30, 2023
1 parent bf6cf6f commit 8e081f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3719,14 +3719,14 @@
(and (true? old-heading) (nil? heading)))
(set-block-property-aux! block :heading heading)

(or (or (nil? heading) (true? heading))
(number? old-heading))
(and (or (nil? heading) (true? heading))
(number? old-heading))
(let [block' (set-block-property-aux! block :heading heading)
content (commands/clear-markdown-heading (:block/content block'))]
(merge block' {:block/content content}))

(or (or (nil? old-heading) (true? old-heading))
(number? heading))
(and (or (nil? old-heading) (true? old-heading))
(number? heading))
(let [block' (set-block-property-aux! block :heading nil)
properties (assoc (:block/properties block) :heading heading)
content (commands/set-markdown-heading (:block/content block') heading)]
Expand Down

0 comments on commit 8e081f5

Please sign in to comment.