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 " followed by text" $ "main contentnon-main content" =?>
doc (divWith ("", [], [("role", "main")]) (plain (text "main content")) <> plain (text "non-main content"))
]
+ , testGroup "code"
+ [
+ test html "inline code block" $
+ "Answer is 42" =?>
+ plain (codeWith ("",[],[]) "Answer is 42")
+ ]
+ , testGroup "tt"
+ [
+ test html "inline tt block" $
+ "Answer is 42" =?>
+ 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"))
=?> "examples
"
]
+ , testGroup "code"
+ [ "code should be rendered correctly" =:
+ plain (codeWith ("",[],[]) "Answer is 42") =?>
+ "Answer is 42"
+ ]
, testGroup "sample"
[ "sample should be rendered correctly" =:
plain (codeWith ("",["sample"],[]) "Answer is 42") =?>