diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Readers/Markdown.hs | 8 | ||||
-rw-r--r-- | test/command/3716.md | 2 | ||||
-rw-r--r-- | test/command/4913.md | 34 | ||||
-rw-r--r-- | test/markdown-reader-more.native | 8 | ||||
-rw-r--r-- | test/testsuite.native | 8 | ||||
-rw-r--r-- | test/writer.docbook4 | 6 | ||||
-rw-r--r-- | test/writer.docbook5 | 6 | ||||
-rw-r--r-- | test/writer.html4 | 2 | ||||
-rw-r--r-- | test/writer.html5 | 2 | ||||
-rw-r--r-- | test/writer.native | 8 | ||||
-rw-r--r-- | test/writer.textile | 2 |
11 files changed, 61 insertions, 25 deletions
diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs index bc8e55615..be89e708e 100644 --- a/test/Tests/Readers/Markdown.hs +++ b/test/Tests/Readers/Markdown.hs @@ -39,7 +39,7 @@ testBareLink (inp, ils) = (unpack inp) (inp, doc $ para ils) autolink :: String -> Inlines -autolink = autolinkWith nullAttr +autolink = autolinkWith ("",["uri"],[]) autolinkWith :: Attr -> String -> Inlines autolinkWith attr s = linkWith attr s "" (str s) @@ -72,10 +72,12 @@ bareLinkTests = , ("http://en.wikipedia.org/wiki/Sprite_(computer_graphics)", autolink "http://en.wikipedia.org/wiki/Sprite_(computer_graphics)") , ("http://en.wikipedia.org/wiki/Sprite_[computer_graphics]", - link "http://en.wikipedia.org/wiki/Sprite_%5Bcomputer_graphics%5D" "" + linkWith ("",["uri"],[]) + "http://en.wikipedia.org/wiki/Sprite_%5Bcomputer_graphics%5D" "" (str "http://en.wikipedia.org/wiki/Sprite_[computer_graphics]")) , ("http://en.wikipedia.org/wiki/Sprite_{computer_graphics}", - link "http://en.wikipedia.org/wiki/Sprite_%7Bcomputer_graphics%7D" "" + linkWith ("",["uri"],[]) + "http://en.wikipedia.org/wiki/Sprite_%7Bcomputer_graphics%7D" "" (str "http://en.wikipedia.org/wiki/Sprite_{computer_graphics}")) , ("http://example.com/Notification_Center-GitHub-20101108-140050.jpg", autolink "http://example.com/Notification_Center-GitHub-20101108-140050.jpg") diff --git a/test/command/3716.md b/test/command/3716.md index 7e00819da..81e4a9568 100644 --- a/test/command/3716.md +++ b/test/command/3716.md @@ -2,5 +2,5 @@ % pandoc <http://example.com>{.foo} ^D -<p><a href="http://example.com" class="uri foo">http://example.com</a></p> +<p><a href="http://example.com" class="foo">http://example.com</a></p> ``` diff --git a/test/command/4913.md b/test/command/4913.md new file mode 100644 index 000000000..6492b80ce --- /dev/null +++ b/test/command/4913.md @@ -0,0 +1,34 @@ +``` +% pandoc -f markdown -t html +[https://pandoc.org](https://pandoc.org) +^D +<p><a href="https://pandoc.org">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t markdown +[https://pandoc.org](https://pandoc.org) +^D +<https://pandoc.org> +``` + +``` +% pandoc -f markdown -t html +<https://pandoc.org> +^D +<p><a href="https://pandoc.org" class="uri">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t html +<https://pandoc.org>{.foo} +^D +<p><a href="https://pandoc.org" class="foo">https://pandoc.org</a></p> +``` + +``` +% pandoc -f markdown -t html +<me@example.com> +^D +<p><a href="mailto:me@example.com" class="email">me@example.com</a></p> +``` diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native index 799f4ffa7..9c128ab94 100644 --- a/test/markdown-reader-more.native +++ b/test/markdown-reader-more.native @@ -45,9 +45,9 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Author",S ,Para [Str "`hi"] ,Para [Str "there`"] ,Header 2 ("multilingual-urls",[],[]) [Str "Multilingual",Space,Str "URLs"] -,Para [Link ("",[],[]) [Str "http://\27979.com?\27979=\27979"] ("http://\27979.com?\27979=\27979","")] +,Para [Link ("",["uri"],[]) [Str "http://\27979.com?\27979=\27979"] ("http://\27979.com?\27979=\27979","")] ,Para [Link ("",[],[]) [Str "foo"] ("/bar/\27979?x=\27979","title")] -,Para [Link ("",[],[]) [Str "\27979@foo.\27979.baz"] ("mailto:\27979@foo.\27979.baz","")] +,Para [Link ("",["email"],[]) [Str "\27979@foo.\27979.baz"] ("mailto:\27979@foo.\27979.baz","")] ,Header 2 ("numbered-examples",[],[]) [Str "Numbered",Space,Str "examples"] ,OrderedList (1,Example,TwoParens) [[Plain [Str "First",Space,Str "example."]] @@ -176,8 +176,8 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Author",S ,[]]] ,Header 2 ("entities-in-links-and-titles",[],[]) [Str "Entities",Space,Str "in",Space,Str "links",Space,Str "and",Space,Str "titles"] ,Para [Link ("",[],[]) [Str "link"] ("/\252rl","\246\246!")] -,Para [Link ("",[],[]) [Str "http://g\246\246gle.com"] ("http://g\246\246gle.com","")] -,Para [Link ("",[],[]) [Str "me@ex\228mple.com"] ("mailto:me@ex\228mple.com","")] +,Para [Link ("",["uri"],[]) [Str "http://g\246\246gle.com"] ("http://g\246\246gle.com","")] +,Para [Link ("",["email"],[]) [Str "me@ex\228mple.com"] ("mailto:me@ex\228mple.com","")] ,Para [Link ("",[],[]) [Str "foobar"] ("/\252rl","\246\246!")] ,Header 2 ("parentheses-in-urls",[],[]) [Str "Parentheses",Space,Str "in",Space,Str "URLs"] ,Para [Link ("",[],[]) [Str "link"] ("/hi(there)","")] diff --git a/test/testsuite.native b/test/testsuite.native index fcd189eb0..73fcc0633 100644 --- a/test/testsuite.native +++ b/test/testsuite.native @@ -384,14 +384,14 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Header 2 ("autolinks",[],[]) [Str "Autolinks"] -,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",[],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] +,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",["uri"],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,BulletList [[Plain [Str "In",Space,Str "a",Space,Str "list?"]] - ,[Plain [Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] + ,[Plain [Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] ,[Plain [Str "It",Space,Str "should."]]] -,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",[],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] +,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",["email"],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,BlockQuote - [Para [Str "Blockquoted:",Space,Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] + [Para [Str "Blockquoted:",Space,Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,HorizontalRule diff --git a/test/writer.docbook4 b/test/writer.docbook4 index 163255974..38b3cc1ee 100644 --- a/test/writer.docbook4 +++ b/test/writer.docbook4 @@ -1298,7 +1298,7 @@ These should not be escaped: \$ \\ \> \[ \{ <title>Autolinks</title> <para> With an ampersand: - <ulink url="http://example.com/?foo=1&bar=2">http://example.com/?foo=1&bar=2</ulink> + <ulink url="http://example.com/?foo=1&bar=2" role="uri">http://example.com/?foo=1&bar=2</ulink> </para> <itemizedlist spacing="compact"> <listitem> @@ -1308,7 +1308,7 @@ These should not be escaped: \$ \\ \> \[ \{ </listitem> <listitem> <para> - <ulink url="http://example.com/">http://example.com/</ulink> + <ulink url="http://example.com/" role="uri">http://example.com/</ulink> </para> </listitem> <listitem> @@ -1323,7 +1323,7 @@ These should not be escaped: \$ \\ \> \[ \{ <blockquote> <para> Blockquoted: - <ulink url="http://example.com/">http://example.com/</ulink> + <ulink url="http://example.com/" role="uri">http://example.com/</ulink> </para> </blockquote> <para> diff --git a/test/writer.docbook5 b/test/writer.docbook5 index 992cd8b63..9a9eff0c5 100644 --- a/test/writer.docbook5 +++ b/test/writer.docbook5 @@ -1273,7 +1273,7 @@ These should not be escaped: \$ \\ \> \[ \{ <title>Autolinks</title> <para> With an ampersand: - <link xlink:href="http://example.com/?foo=1&bar=2">http://example.com/?foo=1&bar=2</link> + <link xlink:href="http://example.com/?foo=1&bar=2" role="uri">http://example.com/?foo=1&bar=2</link> </para> <itemizedlist spacing="compact"> <listitem> @@ -1283,7 +1283,7 @@ These should not be escaped: \$ \\ \> \[ \{ </listitem> <listitem> <para> - <link xlink:href="http://example.com/">http://example.com/</link> + <link xlink:href="http://example.com/" role="uri">http://example.com/</link> </para> </listitem> <listitem> @@ -1298,7 +1298,7 @@ These should not be escaped: \$ \\ \> \[ \{ <blockquote> <para> Blockquoted: - <link xlink:href="http://example.com/">http://example.com/</link> + <link xlink:href="http://example.com/" role="uri">http://example.com/</link> </para> </blockquote> <para> diff --git a/test/writer.html4 b/test/writer.html4 index dc889f07a..bed6617a0 100644 --- a/test/writer.html4 +++ b/test/writer.html4 @@ -508,7 +508,7 @@ Blah <li><a href="http://example.com/" class="uri">http://example.com/</a></li> <li>It should.</li> </ul> -<p>An e-mail address: <a href="mailto:nobody@nowhere.net">nobody@nowhere.net</a></p> +<p>An e-mail address: <a href="mailto:nobody@nowhere.net" class="email">nobody@nowhere.net</a></p> <blockquote> <p>Blockquoted: <a href="http://example.com/" class="uri">http://example.com/</a></p> </blockquote> diff --git a/test/writer.html5 b/test/writer.html5 index 4f80231db..46105d0a6 100644 --- a/test/writer.html5 +++ b/test/writer.html5 @@ -511,7 +511,7 @@ Blah <li><a href="http://example.com/" class="uri">http://example.com/</a></li> <li>It should.</li> </ul> -<p>An e-mail address: <a href="mailto:nobody@nowhere.net">nobody@nowhere.net</a></p> +<p>An e-mail address: <a href="mailto:nobody@nowhere.net" class="email">nobody@nowhere.net</a></p> <blockquote> <p>Blockquoted: <a href="http://example.com/" class="uri">http://example.com/</a></p> </blockquote> diff --git a/test/writer.native b/test/writer.native index fcd189eb0..73fcc0633 100644 --- a/test/writer.native +++ b/test/writer.native @@ -384,14 +384,14 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link"] ("/script?foo=1&bar=2",""),Str "."] ,Para [Str "Here\8217s",Space,Str "an",Space,Link ("",[],[]) [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] ("/script?foo=1&bar=2",""),Str "."] ,Header 2 ("autolinks",[],[]) [Str "Autolinks"] -,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",[],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] +,Para [Str "With",Space,Str "an",Space,Str "ampersand:",Space,Link ("",["uri"],[]) [Str "http://example.com/?foo=1&bar=2"] ("http://example.com/?foo=1&bar=2","")] ,BulletList [[Plain [Str "In",Space,Str "a",Space,Str "list?"]] - ,[Plain [Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] + ,[Plain [Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] ,[Plain [Str "It",Space,Str "should."]]] -,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",[],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] +,Para [Str "An",Space,Str "e-mail",Space,Str "address:",Space,Link ("",["email"],[]) [Str "nobody@nowhere.net"] ("mailto:nobody@nowhere.net","")] ,BlockQuote - [Para [Str "Blockquoted:",Space,Link ("",[],[]) [Str "http://example.com/"] ("http://example.com/","")]] + [Para [Str "Blockquoted:",Space,Link ("",["uri"],[]) [Str "http://example.com/"] ("http://example.com/","")]] ,Para [Str "Auto-links",Space,Str "should",Space,Str "not",Space,Str "occur",Space,Str "here:",Space,Code ("",[],[]) "<http://example.com/>"] ,CodeBlock ("",[],[]) "or here: <http://example.com/>" ,HorizontalRule diff --git a/test/writer.textile b/test/writer.textile index d19b698f9..78e659091 100644 --- a/test/writer.textile +++ b/test/writer.textile @@ -660,7 +660,7 @@ With an ampersand: "$":http://example.com/?foo=1&bar=2 * "$":http://example.com/ * It should. -An e-mail address: "nobody@nowhere.net":mailto:nobody@nowhere.net +An e-mail address: "(email)nobody@nowhere.net":mailto:nobody@nowhere.net bq. Blockquoted: "$":http://example.com/ |