From df3a80cc97e99a8f4fdb8bf80b5ca85a216111b2 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Tue, 21 Nov 2017 17:41:29 +0300 Subject: Muse writer: escape only inside code tag Additional is not needed as is verbatim already. --- src/Text/Pandoc/Writers/Muse.hs | 2 +- test/Tests/Readers/Muse.hs | 2 ++ test/Tests/Writers/Muse.hs | 3 +-- test/writer.muse | 15 ++++++--------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Text/Pandoc/Writers/Muse.hs b/src/Text/Pandoc/Writers/Muse.hs index 3a5eefc18..c834e5883 100644 --- a/src/Text/Pandoc/Writers/Muse.hs +++ b/src/Text/Pandoc/Writers/Muse.hs @@ -328,7 +328,7 @@ inlineToMuse (Quoted DoubleQuote lst) = do -- so just fallback to expanding inlines. inlineToMuse (Cite _ lst) = inlineListToMuse lst inlineToMuse (Code _ str) = return $ - "" <> text (conditionalEscapeString str) <> "" + "" <> text (substitute "" "</code>" str) <> "" inlineToMuse (Math InlineMath str) = lift (texMathToInlines InlineMath str) >>= inlineListToMuse inlineToMuse (Math DisplayMath str) = do 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" =: "***" =?> para (emph "*") + , "Verbatim inside code" =: "foo" =?> para (code "foo") + , 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" =?> "foo" - , "escape lightweight markup" =: code "foo = bar" =?> "foo = bar" - , "escape tag" =: code "foo = bar baz" =?> "foo = bar baz" + , "escape tag" =: code "foo = bar baz" =?> "foo = bar</code> baz" ] , 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 this word. So is this word. -This is code: >, $, -\, \$, . +This is code: >, $, \, \$, +. This is strikeout. @@ -529,8 +529,7 @@ Ellipses…and…and…. These shouldn’t be math: - - To get the famous equation, write - $e = mc^2$. + - To get the famous equation, write $e = mc^2$. - $22,000 is a lot 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/]] -Auto-links should not occur here: - +Auto-links should not occur here: or here: @@ -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 easier to type. Inline notes may contain - [[http://google.com][links]] and ] - verbatim characters, as well as [bracketed - text]. + [[http://google.com][links]] and ] verbatim characters, as + well as [bracketed text]. [4] In quote. -- cgit v1.2.3