mirror of https://github.com/logseq/logseq
parent
cdf9492357
commit
05f1b02d74
|
@ -40,11 +40,9 @@
|
|||
(sep-by-comma-or-quote)
|
||||
(map page-ref-un-brackets!)
|
||||
(distinct))]
|
||||
(if (and (coll? result)
|
||||
(or (> (count result) 1)
|
||||
;; Tag
|
||||
(and (string? result)
|
||||
(string/starts-with? result "#"))))
|
||||
(if (or (coll? result)
|
||||
(and (string? result)
|
||||
(string/starts-with? result "#")))
|
||||
(let [result (if coll? result [result])
|
||||
result (map (fn [s] (string/replace s #"^#+" "")) result)]
|
||||
(set result))
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
(ns frontend.version)
|
||||
|
||||
(defonce version "0.0.5.1-5")
|
||||
(defonce version "0.0.5.1-6")
|
||||
|
|
|
@ -39,20 +39,22 @@
|
|||
"foo bar" "foo bar"
|
||||
"foo, bar" #{"foo" "bar"}
|
||||
"foo \"bar\"" #{"foo" "bar"}
|
||||
"[[foo]] [[bar]]" #{"[[foo]] [[bar]]"}
|
||||
"[[foo]] [[bar]]" #{"foo]] [[bar"}
|
||||
"[[foo]],[[bar]]" #{"foo", "bar"}
|
||||
"[[foo]], [[bar]]" #{"foo", "bar"}
|
||||
"[[foo]]" "foo"
|
||||
"[[nested [[foo]]]]" "nested [[foo]]"
|
||||
"[[nested [[foo]]]], [[foo]]" #{"nested [[foo]]" "foo"}))
|
||||
"[[foo]]" #{"foo"}
|
||||
"[[nested [[foo]]]]" #{"nested [[foo]]"}
|
||||
"[[nested [[foo]]]], [[foo]]" #{"nested [[foo]]" "foo"}
|
||||
"#tag," #{"tag"}
|
||||
"#tag1,#tag2" #{"tag1" "tag2"}))
|
||||
|
||||
(defn extract-level-spaces
|
||||
[]
|
||||
(testing "markdown"
|
||||
(are [x y] (= (text/extract-level-spaces x :markdown) y)
|
||||
"# foobar" "# "
|
||||
"## foobar" "## "
|
||||
"##################### foobar" "##################### "))
|
||||
"# foobar" "# "
|
||||
"## foobar" "## "
|
||||
"##################### foobar" "##################### "))
|
||||
(testing "org mode"
|
||||
(are [x y] (= (text/extract-level-spaces x :org) y)
|
||||
"* foobar" "* "
|
||||
|
@ -77,10 +79,10 @@
|
|||
"** foobar" "foobar"
|
||||
"********************* foobar" "foobar"))
|
||||
(testing "org without spaces between the `#` and title"
|
||||
(are [x y] (= (text/remove-level-spaces x :org) y)
|
||||
"*foobar" "foobar"
|
||||
"**foobar" "foobar"
|
||||
"*********************foobar" "foobar")))
|
||||
(are [x y] (= (text/remove-level-spaces x :org) y)
|
||||
"*foobar" "foobar"
|
||||
"**foobar" "foobar"
|
||||
"*********************foobar" "foobar")))
|
||||
|
||||
(defn append-newline-after-level-spaces
|
||||
[]
|
||||
|
|
Loading…
Reference in New Issue