summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs2
-rw-r--r--test/Tests/Readers/HTML.hs12
-rw-r--r--test/Tests/Writers/HTML.hs5
3 files changed, 18 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 7d192a2d3..b3a2b8c42 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -662,7 +662,7 @@ inline = pTagText <|> do
"img" -> pImage
"svg" -> pSvg
"bdo" -> pBdo
- "tt" -> pCode
+ "tt" -> pCode
"code" -> pCode
"samp" -> pCodeWithClass "samp" "sample"
"var" -> pCodeWithClass "var" "variable"
diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs
index eec5da643..b1d847354 100644
--- a/test/Tests/Readers/HTML.hs
+++ b/test/Tests/Readers/HTML.hs
@@ -98,6 +98,18 @@ tests = [ testGroup "base tag"
, test htmlNativeDivs "<main> followed by text" $ "<main>main content</main>non-main content" =?>
doc (divWith ("", [], [("role", "main")]) (plain (text "main content")) <> plain (text "non-main content"))
]
+ , testGroup "code"
+ [
+ test html "inline code block" $
+ "<code>Answer is 42</code>" =?>
+ plain (codeWith ("",[],[]) "Answer is 42")
+ ]
+ , testGroup "tt"
+ [
+ test html "inline tt block" $
+ "<tt>Answer is 42</tt>" =?>
+ plain (codeWith ("",[],[]) "Answer is 42")
+ ]
, testGroup "samp"
[
test html "inline samp block" $
diff --git a/test/Tests/Writers/HTML.hs b/test/Tests/Writers/HTML.hs
index 5176af1f0..3ec7a866d 100644
--- a/test/Tests/Writers/HTML.hs
+++ b/test/Tests/Writers/HTML.hs
@@ -84,6 +84,11 @@ tests =
doubleQuoted (spanWith ("", [], [("cite", "http://example.org")]) (str "examples"))
=?> "<q cite=\"http://example.org\">examples</q>"
]
+ , testGroup "code"
+ [ "code should be rendered correctly" =:
+ plain (codeWith ("",[],[]) "Answer is 42") =?>
+ "<code>Answer is 42</code>"
+ ]
, testGroup "sample"
[ "sample should be rendered correctly" =:
plain (codeWith ("",["sample"],[]) "Answer is 42") =?>