mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
Working,, but regression in Mermaid stylesheet
This commit is contained in:
parent
03c63da19e
commit
f82ad725c1
5 changed files with 39 additions and 3 deletions
7
resources/test/test_extension.md
Normal file
7
resources/test/test_extension.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This is a test
|
||||||
|
|
||||||
|
```test
|
||||||
|
the quick brown fox jumped over the lazy dog
|
||||||
|
```
|
||||||
|
|
||||||
|
This concludes the test.
|
||||||
6
resources/test/test_local_links.md
Normal file
6
resources/test/test_local_links.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# This is a test
|
||||||
|
|
||||||
|
[[Local link]]
|
||||||
|
[Not a local link](http://nowhere.at.al)
|
||||||
|
|
||||||
|
This concludes the test.
|
||||||
|
|
@ -104,7 +104,6 @@
|
||||||
^String fragment
|
^String fragment
|
||||||
^String token
|
^String token
|
||||||
formatter]
|
formatter]
|
||||||
(log/info "index:" index "(type result):" (type result) "(type fragments):" (type fragments) "fragment:" fragment "token:" token ":formatter" formatter)
|
|
||||||
(let
|
(let
|
||||||
[inky (keyword (str "inclusion-" index))
|
[inky (keyword (str "inclusion-" index))
|
||||||
fkey (keyword token)]
|
fkey (keyword token)]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
(ns smeagol.test.formatting
|
(ns smeagol.test.formatting
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
|
[clojure.string :as cs]
|
||||||
[smeagol.formatting :refer :all]
|
[smeagol.formatting :refer :all]
|
||||||
[smeagol.extensions.test :refer :all]
|
[smeagol.extensions.test :refer :all]
|
||||||
[smeagol.local-links :refer :all]))
|
[smeagol.local-links :refer :all]))
|
||||||
|
|
@ -22,3 +23,21 @@
|
||||||
:inclusion-3)
|
:inclusion-3)
|
||||||
expected "<!-- The test extension has run and this is its output -->"]
|
expected "<!-- The test extension has run and this is its output -->"]
|
||||||
(is (= actual expected)))))
|
(is (= actual expected)))))
|
||||||
|
|
||||||
|
(deftest test-md->html
|
||||||
|
(let [actual (:content (md->html
|
||||||
|
{:source
|
||||||
|
(cs/join
|
||||||
|
"\n"
|
||||||
|
["# This is a test"
|
||||||
|
""
|
||||||
|
"```test"
|
||||||
|
""
|
||||||
|
"```"
|
||||||
|
""
|
||||||
|
"This concludes the test"])} ))
|
||||||
|
expected (str
|
||||||
|
"<h1 id=\"this_is_a_test\">This is a test</h1>"
|
||||||
|
"<p><!-- The test extension has run and this is its output --></p>"
|
||||||
|
"<p>This concludes the test</p>")]
|
||||||
|
(is (= expected actual))))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
(ns smeagol.test.local-links
|
(ns smeagol.test.local-links
|
||||||
(:require [clojure.test :refer :all]
|
(:require [clojure.test :refer :all]
|
||||||
|
[clojure.string :as cs]
|
||||||
[smeagol.local-links :refer [local-links no-text-error]]
|
[smeagol.local-links :refer [local-links no-text-error]]
|
||||||
[smeagol.extensions.test :refer :all]
|
[smeagol.extensions.test :refer :all]
|
||||||
[smeagol.local-links :refer :all]))
|
[smeagol.local-links :refer :all]))
|
||||||
|
|
@ -10,5 +11,9 @@
|
||||||
(is (= (local-links "") "") "Empty string should pass through unchanged.")
|
(is (= (local-links "") "") "Empty string should pass through unchanged.")
|
||||||
(is (= (local-links "[[froboz]]") "<a href='wiki?page=froboz'>froboz</a>") "Local link should be rewritten.")
|
(is (= (local-links "[[froboz]]") "<a href='wiki?page=froboz'>froboz</a>") "Local link should be rewritten.")
|
||||||
(let [text (str "# This is a heading"
|
(let [text (str "# This is a heading"
|
||||||
"[This is a foreign link](http://to.somewhere)")]
|
"[This is a foreign link](http://to.somewhere)")]
|
||||||
(is (= (local-links text) text) "Foreign links should be unchanged"))))
|
(is (= (local-links text) text) "Foreign links should be unchanged"))
|
||||||
|
(let [text (cs/trim (slurp "resources/test/test_local_links.md"))
|
||||||
|
actual (local-links text)
|
||||||
|
expected "# This is a test\n\n<a href='wiki?page=Local%20link'>Local link</a>\n[Not a local link](http://nowhere.at.al)\n\nThis concludes the test."]
|
||||||
|
(is (= actual expected)))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue