@@ -72,9 +72,39 @@ tests =
7272
7373 , "Linebreak" =: "Line <br> break" =?> para ("Line" <> linebreak <> "break")
7474
75− , "Code" =: "=foo(bar)=" =?> para (code "foo(bar)")
75+ , testGroup "Code markup"
76+ [ "Code" =: "=foo(bar)=" =?> para (code "foo(bar)")
7677
77− , "Not code" =: "a=b= =c=d" =?> para (text "a=b= =c=d")
78+ , "Not code" =: "a=b= =c=d" =?> para (text "a=b= =c=d")
79+
80+ -- Emacs Muse 3.20 parses this as code, we follow Amusewiki
81+ , "Not code if closing = is detached" =: "=this is not a code =" =?> para "=this is not a code ="
82+
83+ , "Not code if opening = is detached" =: "= this is not a code=" =?> para "= this is not a code="
84+
85+ , "One character code" =: "=c=" =?> para (code "c")
86+
87+ , "Three = characters is not a code" =: "===" =?> para "==="
88+
89+ , "Multiline code markup" =:
90+ "foo =bar\nbaz= end of code" =?>
91+ para (text "foo " <> code "bar\nbaz" <> text " end of code")
92+
93+{- Emacs Muse 3.20 has a bug: it publishes
94+ - <p>foo <code>bar
95+ -
96+ - baz</code> foo</p>
97+ - which is displayed as one paragraph by browsers.
98+ - We follow Amusewiki here and avoid joining paragraphs.
99+ -}
100+ , "No multiparagraph code" =:
101+ T.unlines [ "foo =bar"
102+ , ""
103+ , "baz= foo"
104+ ] =?>
105+ para "foo =bar" <>
106+ para "baz= foo"
107+ ]
78108
79109 , "Code tag" =: "<code>foo(bar)</code>" =?> para (code "foo(bar)")
80110