From df3a80cc97e99a8f4fdb8bf80b5ca85a216111b2 Mon Sep 17 00:00:00 2001 From: Alexander Krotov <ilabdsf@gmail.com> Date: Tue, 21 Nov 2017 17:41:29 +0300 Subject: Muse writer: escape only </code> inside code tag Additional <verbatim> is not needed as <code> is verbatim already. --- test/Tests/Readers/Muse.hs | 2 ++ test/Tests/Writers/Muse.hs | 3 +-- test/writer.muse | 15 ++++++--------- 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 0202dfb6d..a0362b80c 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -123,6 +123,8 @@ tests = , "Verbatim tag" =: "*<verbatim>*</verbatim>*" =?> para (emph "*") + , "Verbatim inside code" =: "<code><verbatim>foo</verbatim></code>" =?> para (code "<verbatim>foo</verbatim>") + , testGroup "Links" [ "Link without description" =: "[[https://amusewiki.org/]]" =?> diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index a6c1edc3b..7e95ae85e 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -296,8 +296,7 @@ tests = [ testGroup "block elements" -- Cite is trivial , testGroup "code" [ "simple" =: code "foo" =?> "<code>foo</code>" - , "escape lightweight markup" =: code "foo = bar" =?> "<code><verbatim>foo = bar</verbatim></code>" - , "escape tag" =: code "<code>foo = bar</code> baz" =?> "<code><verbatim><code>foo = bar</code> baz</verbatim></code>" + , "escape tag" =: code "<code>foo = bar</code> baz" =?> "<code><code>foo = bar<</code><code>/code> baz</code>" ] , testGroup "spaces" [ "space" =: text "a" <> space <> text "b" =?> "a b" diff --git a/test/writer.muse b/test/writer.muse index 6ba3beb90..6c9dd9869 100644 --- a/test/writer.muse +++ b/test/writer.muse @@ -478,8 +478,8 @@ So is <strong><em>this</em></strong> word. So is <strong><em>this</em></strong> word. -This is code: <code><verbatim>></verbatim></code>, <code>$</code>, -<code>\</code>, <code>\$</code>, <code><verbatim><html></verbatim></code>. +This is code: <code>></code>, <code>$</code>, <code>\</code>, <code>\$</code>, +<code><html></code>. <del>This is <em>strikeout</em>.</del> @@ -529,8 +529,7 @@ Ellipses…and…and…. These shouldn’t be math: - - To get the famous equation, write - <code><verbatim>$e = mc^2$</verbatim></code>. + - To get the famous equation, write <code>$e = mc^2$</code>. - $22,000 is a <em>lot</em> of money. So is $34,000. (It worked if "lot" is emphasized.) - Shoes ($20) and socks ($5). @@ -673,8 +672,7 @@ An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]] Blockquoted: [[http://example.com/]] </quote> -Auto-links should not occur here: -<code><verbatim><http://example.com/></verbatim></code> +Auto-links should not occur here: <code><http://example.com/></code> <example> or here: <http://example.com/> @@ -722,9 +720,8 @@ This paragraph should not be part of the note, as it is not indented. indent the first line of each block. [3] This is <em>easier</em> to type. Inline notes may contain - [[http://google.com][links]] and <code><verbatim>]</verbatim></code> - verbatim characters, as well as <verbatim>[bracketed</verbatim> - <verbatim>text].</verbatim> + [[http://google.com][links]] and <code>]</code> verbatim characters, as + well as <verbatim>[bracketed</verbatim> <verbatim>text].</verbatim> [4] In quote. -- cgit v1.2.3