aboutsummaryrefslogtreecommitdiff
path: root/test/Tests/Writers
diff options
context:
space:
mode:
authorAmogh Rathore <amoghdroid09@gmail.com>2019-11-05 01:42:30 +0900
committerJohn MacFarlane <jgm@berkeley.edu>2019-11-04 08:42:30 -0800
commitbd2bd9b19d949f59a64358f756bf8b398a13db0f (patch)
treea266e1c6ae9a0d183695bd82e9cd5a89e12d8970 /test/Tests/Writers
parentfdc0f47519d330bcc641eeaee68486431d3c46a5 (diff)
downloadpandoc-bd2bd9b19d949f59a64358f756bf8b398a13db0f.tar.gz
HTML Reader/Writer - Add support for <var> and <samp> (#5861)
Closes #5799
Diffstat (limited to 'test/Tests/Writers')
-rw-r--r--test/Tests/Writers/HTML.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs
index 94549e0d8..f3c7b87fd 100644
--- a/test/Tests/Writers/HTML.hs
+++ b/test/Tests/Writers/HTML.hs
@@ -61,6 +61,28 @@ tests = [ testGroup "inline code"
doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
=?> "<q cite=\"http://example.org\">examples</q>"
]
+ , testGroup "sample"
+ [ "sample should be rendered correctly" =:
+ plain (codeWith ("",["sample"],[]) "Answer is 42") =?>
+ "<samp>Answer is 42</samp>"
+ ]
+ , testGroup "variable"
+ [ "variable should be rendered correctly" =:
+ plain (codeWith ("",["variable"],[]) "result") =?>
+ "<var>result</var>"
+ ]
+ , testGroup "sample with style"
+ [ "samp should wrap highlighted code" =:
+ codeWith ("",["sample","haskell"],[]) ">>="
+ =?> ("<samp><code class=\"sourceCode haskell\">" ++
+ "<span class=\"op\">&gt;&gt;=</span></code></samp>")
+ ]
+ , testGroup "variable with style"
+ [ "var should wrap highlighted code" =:
+ codeWith ("",["haskell","variable"],[]) ">>="
+ =?> ("<var><code class=\"sourceCode haskell\">" ++
+ "<span class=\"op\">&gt;&gt;=</span></code></var>")
+ ]
]
where
tQ :: (ToString a, ToPandoc a)