From 7de23f13976e922e08370ebdf16da5ded0176262 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 30 Apr 2021 19:31:18 +0800 Subject: [PATCH] fix: remove-property! --- src/main/frontend/text.cljs | 2 +- src/test/frontend/text_test.cljs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/text.cljs b/src/main/frontend/text.cljs index e8ee4bc3b..44506e1c7 100644 --- a/src/main/frontend/text.cljs +++ b/src/main/frontend/text.cljs @@ -274,7 +274,7 @@ (let [format (or format :markdown) key (string/lower-case (name key)) remove-f (if first? util/remove-first remove)] - (if-not (and (= format :org) (contains-properties? content)) + (if (and (= format :org) (not (contains-properties? content))) content (let [lines (->> (string/split-lines content) (remove-f (fn [line] diff --git a/src/test/frontend/text_test.cljs b/src/test/frontend/text_test.cljs index 3b0d5d28c..2eaea6fc3 100644 --- a/src/test/frontend/text_test.cljs +++ b/src/test/frontend/text_test.cljs @@ -99,7 +99,7 @@ (defn remove-id-property [] - (are [x y] (= (text/remove-id-property! x) y) + (are [x y] (= (text/remove-id-property! :org x) y) "hello\n:PROPERTIES:\n:id: f9873a81-07b9-4246-b910-53a6f5ec7e04\n:END:\n" "hello\n:PROPERTIES:\n:END:"