Prechádzať zdrojové kódy

fix: remove-property!

Tienson Qin 4 rokov pred
rodič
commit
7de23f1397

+ 1 - 1
src/main/frontend/text.cljs

@@ -274,7 +274,7 @@
      (let [format (or format :markdown)
      (let [format (or format :markdown)
            key (string/lower-case (name key))
            key (string/lower-case (name key))
            remove-f (if first? util/remove-first remove)]
            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
          content
          (let [lines (->> (string/split-lines content)
          (let [lines (->> (string/split-lines content)
                           (remove-f (fn [line]
                           (remove-f (fn [line]

+ 1 - 1
src/test/frontend/text_test.cljs

@@ -99,7 +99,7 @@
 
 
 (defn remove-id-property
 (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:id: f9873a81-07b9-4246-b910-53a6f5ec7e04\n:END:\n"
     "hello\n:PROPERTIES:\n:END:"
     "hello\n:PROPERTIES:\n:END:"