feat: simplified markdown properties wip

This commit is contained in:
Tienson Qin
2021-04-30 18:30:33 +08:00
parent 72abf65dcc
commit 0c758fc268
9 changed files with 136 additions and 188 deletions

View File

@@ -99,7 +99,7 @@
(defn remove-id-property
[]
(are [x y] (= (text/remove-id-property x) y)
(are [x y] (= (text/remove-id-property! x) y)
"hello\n:PROPERTIES:\n:id: f9873a81-07b9-4246-b910-53a6f5ec7e04\n:END:\n"
"hello\n:PROPERTIES:\n:END:"
@@ -126,16 +126,16 @@
(defn test-insert-property
[]
(are [x y] (= x y)
(text/insert-property "hello" "a" "b")
(text/insert-property! :org "hello" "a" "b")
"hello\n:PROPERTIES:\n:a: b\n:END:\n"
(text/insert-property "hello" "a" false)
(text/insert-property! :org "hello" "a" false)
"hello\n:PROPERTIES:\n:a: false\n:END:\n"
(text/insert-property "hello\n:PROPERTIES:\n:a: b\n:END:\n" "c" "d")
(text/insert-property! :org "hello\n:PROPERTIES:\n:a: b\n:END:\n" "c" "d")
"hello\n:PROPERTIES:\n:a: b\n:c: d\n:END:"
(text/insert-property "hello\n:PROPERTIES:\n:a: b\n:END: world\n" "c" "d")
(text/insert-property! :org "hello\n:PROPERTIES:\n:a: b\n:END: world\n" "c" "d")
"hello\n:PROPERTIES:\n:c: d\n:END:\n:PROPERTIES:\n:a: b\n:END: world\n"))
(defn test->new-properties