@@ -34,55 +34,60 @@ infix 4 =:
34(=:) = test html
34(=:) = test html
36tests :: [TestTree]
36tests :: [TestTree]
37−tests = [ testGroup "inline code"
38+ [ testGroup "inline code"
38− [ "basic" =: code "@&" =?> "<code>@&</code>"
39+ [ "basic" =: code "@&" =?> "<code>@&</code>"
39− , "haskell" =: codeWith ("",["haskell"],[]) ">>="
40+ , "haskell" =: codeWith ("",["haskell"],[]) ">>="
40− =?> "<code class=\"sourceCode haskell\"><span class=\"op\">>>=</span></code>"
41+ =?> "<code class=\"sourceCode haskell\"><span class=\"op\">>>=</span></code>"
41− , "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
42+ , "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>="
42− =?> "<code class=\"nolanguage\">>>=</code>"
43+ =?> "<code class=\"nolanguage\">>>=</code>"
44− , testGroup "images"
45+ , testGroup "images"
45− [ "alt with formatting" =:
46+ [ "alt with formatting" =:
46− image "/url" "title" ("my " <> emph "image")
47+ image "/url" "title" ("my " <> emph "image")
47− =?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />"
48+ =?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />"
49− , testGroup "blocks"
50+ , testGroup "blocks"
50− [ "definition list with empty <dt>" =:
51+ [ "definition list with empty <dt>" =:
51− definitionList [(mempty, [para $ text "foo bar"])]
52+ definitionList [(mempty, [para $ text "foo bar"])]
52− =?> "<dl><dt></dt><dd><p>foo bar</p></dd></dl>"
53+ =?> "<dl><dt></dt><dd><p>foo bar</p></dd></dl>"
54+ , "heading with disallowed attributes" =:
55+ headerWith ("", [], [("invalid","1"), ("lang", "en")]) 1 "test"
57+ "<h1 lang=\"en\">test</h1>"
54− , testGroup "quotes"
59+ , testGroup "quotes"
55− [ "quote with cite attribute (without q-tags)" =:
60+ [ "quote with cite attribute (without q-tags)" =:
56− doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
61+ doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
57− =?> "“<span cite=\"http://example.org\">examples</span>”"
62+ =?> "“<span cite=\"http://example.org\">examples</span>”"
58− , tQ "quote with cite attribute (with q-tags)" $
63+ , tQ "quote with cite attribute (with q-tags)" $
59− doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
64+ doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
60− =?> "<q cite=\"http://example.org\">examples</q>"
65+ =?> "<q cite=\"http://example.org\">examples</q>"
62− , testGroup "sample"
67+ , testGroup "sample"
63− [ "sample should be rendered correctly" =:
68+ [ "sample should be rendered correctly" =:
64− plain (codeWith ("",["sample"],[]) "Answer is 42") =?>
69+ plain (codeWith ("",["sample"],[]) "Answer is 42") =?>
65− "<samp>Answer is 42</samp>"
70+ "<samp>Answer is 42</samp>"
67− , testGroup "variable"
72+ , testGroup "variable"
68− [ "variable should be rendered correctly" =:
73+ [ "variable should be rendered correctly" =:
69− plain (codeWith ("",["variable"],[]) "result") =?>
74+ plain (codeWith ("",["variable"],[]) "result") =?>
70− "<var>result</var>"
75+ "<var>result</var>"
72− , testGroup "sample with style"
77+ , testGroup "sample with style"
73− [ "samp should wrap highlighted code" =:
78+ [ "samp should wrap highlighted code" =:
74− codeWith ("",["sample","haskell"],[]) ">>="
79+ codeWith ("",["sample","haskell"],[]) ">>="
75− =?> ("<samp><code class=\"sourceCode haskell\">" ++
80+ =?> ("<samp><code class=\"sourceCode haskell\">" ++
76− "<span class=\"op\">>>=</span></code></samp>")
81+ "<span class=\"op\">>>=</span></code></samp>")
78− , testGroup "variable with style"
83+ , testGroup "variable with style"
79− [ "var should wrap highlighted code" =:
84+ [ "var should wrap highlighted code" =:
80− codeWith ("",["haskell","variable"],[]) ">>="
85+ codeWith ("",["haskell","variable"],[]) ">>="
81− =?> ("<var><code class=\"sourceCode haskell\">" ++
86+ =?> ("<var><code class=\"sourceCode haskell\">" ++
82− "<span class=\"op\">>>=</span></code></var>")
87+ "<span class=\"op\">>>=</span></code></var>")
86− tQ :: (ToString a, ToPandoc a)
91+ tQ :: (ToString a, ToPandoc a)
87− => String -> (a, String) -> TestTree
92+ => String -> (a, String) -> TestTree
88− tQ = test htmlQTags
93+ tQ = test htmlQTags