diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-03-14 12:23:51 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-04-01 19:39:18 +0300 |
commit | aca4137c4094ec921276bf50278dfc58db5634a3 (patch) | |
tree | 09d52083fa7f061146b5cd5c175c2cb0710bbe14 /test | |
parent | bdb84246970151dd9bbb7a0713e36707488f9d97 (diff) | |
download | pandoc-aca4137c4094ec921276bf50278dfc58db5634a3.tar.gz |
Muse writer: only escape brackets when necessary
It includes cases when they can be mistaken for footnotes
and links, as well as inside link description.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Writers/Muse.hs | 3 | ||||
-rw-r--r-- | test/writer.muse | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/test/Tests/Writers/Muse.hs b/test/Tests/Writers/Muse.hs index 88d2db8cf..eca7ed736 100644 --- a/test/Tests/Writers/Muse.hs +++ b/test/Tests/Writers/Muse.hs @@ -301,8 +301,11 @@ tests = [ testGroup "block elements" [ testGroup "string" [ "string" =: str "foo" =?> "foo" , "escape footnote" =: str "[1]" =?> "<verbatim>[1]</verbatim>" + , "do not escape brackets" =: str "[12ab]" =?> "[12ab]" , "escape verbatim close tag" =: str "foo</verbatim>bar" =?> "<verbatim>foo<</verbatim><verbatim>/verbatim>bar</verbatim>" + , "escape link-like text" =: str "[[https://www.example.org]]" + =?> "<verbatim>[[https://www.example.org]]</verbatim>" , "escape pipe to avoid accidental tables" =: str "foo | bar" =?> "<verbatim>foo | bar</verbatim>" , "escape hash to avoid accidental anchors" =: text "#foo bar" diff --git a/test/writer.muse b/test/writer.muse index c534b63b3..83a53a1ab 100644 --- a/test/writer.muse +++ b/test/writer.muse @@ -576,9 +576,9 @@ Left brace: { Right brace: } -Left bracket: <verbatim>[</verbatim> +Left bracket: [ -Right bracket: <verbatim>]</verbatim> +Right bracket: ] Left paren: ( @@ -634,7 +634,7 @@ Indented [[/url][twice]]. Indented [[/url][thrice]]. -This should <verbatim>[not][]</verbatim> be a link. +This should [not][] be a link. <example> [not]: /url @@ -690,8 +690,8 @@ Here is a movie [[movie.jpg][movie]] icon. * Footnotes Here is a footnote reference,[1] and another.[2] This should <em>not</em> be a -footnote reference, because it contains a <verbatim>space.[^my</verbatim> -<verbatim>note]</verbatim> Here is an inline note.[3] +footnote reference, because it contains a space.[^my note] Here is an inline +note.[3] <quote> Notes can go in quotes.[4] @@ -718,7 +718,7 @@ This paragraph should not be part of the note, as it is not indented. [3] This is <em>easier</em> to type. Inline notes may contain [[http://google.com][links]] and <code>]</code> verbatim characters, as - well as <verbatim>[bracketed</verbatim> <verbatim>text].</verbatim> + well as [bracketed text]. [4] In quote. |