aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/Org/Inline.hs34
-rw-r--r--test/command/5195.md7
-rw-r--r--test/command/gfm.md29
-rw-r--r--test/command/tasklist.md113
-rw-r--r--test/dokuwiki_external_images.dokuwiki2
-rw-r--r--test/writer.dokuwiki4
-rw-r--r--test/writer.zimwiki4
7 files changed, 175 insertions, 18 deletions
diff --git a/test/Tests/Readers/Org/Inline.hs b/test/Tests/Readers/Org/Inline.hs
index 9cfcda79f..e5996d4d8 100644
--- a/test/Tests/Readers/Org/Inline.hs
+++ b/test/Tests/Readers/Org/Inline.hs
@@ -184,26 +184,26 @@ tests =
, testGroup "Images"
[ "Image" =:
- "[[./sunset.jpg]]" =?>
- para (image "./sunset.jpg" "" "")
+ "[[./sunset.jpg]]" =?>
+ para (image "./sunset.jpg" "" "")
, "Image with explicit file: prefix" =:
- "[[file:sunrise.jpg]]" =?>
- para (image "sunrise.jpg" "" "")
+ "[[file:sunrise.jpg]]" =?>
+ para (image "sunrise.jpg" "" "")
, "Multiple images within a paragraph" =:
- T.unlines [ "[[file:sunrise.jpg]]"
- , "[[file:sunset.jpg]]"
- ] =?>
- para ((image "sunrise.jpg" "" "")
+ T.unlines [ "[[file:sunrise.jpg]]"
+ , "[[file:sunset.jpg]]"
+ ] =?>
+ para (image "sunrise.jpg" "" ""
<> softbreak
- <> (image "sunset.jpg" "" ""))
+ <> image "sunset.jpg" "" "")
, "Image with html attributes" =:
- T.unlines [ "#+ATTR_HTML: :width 50%"
- , "[[file:guinea-pig.gif]]"
- ] =?>
- para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
+ T.unlines [ "#+ATTR_HTML: :width 50%"
+ , "[[file:guinea-pig.gif]]"
+ ] =?>
+ para (imageWith ("", [], [("width", "50%")]) "guinea-pig.gif" "" "")
]
, "Explicit link" =:
@@ -215,6 +215,10 @@ tests =
"[[http://zeitlens.com/]]" =?>
para (link "http://zeitlens.com/" "" "http://zeitlens.com/")
+ , "Internal self-link (reference)" =:
+ "[[#rabbit]]" =?>
+ para (link "#rabbit" "" "#rabbit")
+
, "Absolute file link" =:
"[[/url][hi]]" =?>
para (link "file:///url" "" "hi")
@@ -235,6 +239,10 @@ tests =
"[[http://example.com][./logo.png]]" =?>
para (link "http://example.com" "" (image "./logo.png" "" ""))
+ , "Link to image" =:
+ "[[https://example.com/image.jpg][Look!]]" =?>
+ para (link "https://example.com/image.jpg" "" (str "Look!"))
+
, "Plain link" =:
"Posts on http://zeitlens.com/ can be funny at times." =?>
para (spcSep [ "Posts", "on"
diff --git a/test/command/5195.md b/test/command/5195.md
new file mode 100644
index 000000000..10c542eb0
--- /dev/null
+++ b/test/command/5195.md
@@ -0,0 +1,7 @@
+```
+% pandoc -f markdown_strict -t gfm+hard_line_breaks
+Hello
+there
+^D
+Hello there
+```
diff --git a/test/command/gfm.md b/test/command/gfm.md
index 7a7098989..a4bb088b6 100644
--- a/test/command/gfm.md
+++ b/test/command/gfm.md
@@ -101,3 +101,32 @@ hi
^D
[Para [Str "hi",LineBreak,Str "hi"]]
```
+
+```
+% pandoc -f gfm -t native
+- [ ] foo
+- [x] bar
+^D
+[BulletList
+ [[Plain [Str "\9744",Space,Str "foo"]]
+ ,[Plain [Str "\9746",Space,Str "bar"]]]]
+```
+
+```
+% pandoc -f gfm-task_lists -t native
+- [ ] foo
+- [x] bar
+^D
+[BulletList
+ [[Plain [Str "[",Space,Str "]",Space,Str "foo"]]
+ ,[Plain [Str "[x]",Space,Str "bar"]]]]
+```
+
+```
+% pandoc -f gfm -t gfm
+- [ ] foo
+- [x] bar
+^D
+ - [ ] foo
+ - [x] bar
+```
diff --git a/test/command/tasklist.md b/test/command/tasklist.md
new file mode 100644
index 000000000..5ff628e1c
--- /dev/null
+++ b/test/command/tasklist.md
@@ -0,0 +1,113 @@
+tests adapted from <https://github.github.com/gfm/#task-list-items-extension->
+
+```
+% pandoc
+- [ ] foo
+- [x] bar
+^D
+<ul>
+<li><input type="checkbox" disabled="" />
+foo</li>
+<li><input type="checkbox" disabled="" checked="" />
+bar</li>
+</ul>
+```
+
+
+```
+% pandoc
+- [x] foo
+ - [ ] bar
+ - [x] baz
+- [ ] bim
+^D
+<ul>
+<li><input type="checkbox" disabled="" checked="" />
+foo<ul>
+<li><input type="checkbox" disabled="" />
+bar</li>
+<li><input type="checkbox" disabled="" checked="" />
+baz</li>
+</ul></li>
+<li><input type="checkbox" disabled="" />
+bim</li>
+</ul>
+```
+
+
+custom html task list test:
+
+```
+% pandoc
+- [ ] unchecked
+- plain item
+- [x] checked
+
+paragraph
+
+1. [ ] ordered unchecked
+2. [] plain item
+3. [x] ordered checked
+
+paragraph
+
+- [ ] list item with a
+
+ second paragraph
+
+- [x] checked
+^D
+<ul>
+<li><input type="checkbox" disabled="" />
+unchecked</li>
+<li>plain item</li>
+<li><input type="checkbox" disabled="" checked="" />
+checked</li>
+</ul>
+<p>paragraph</p>
+<ol type="1">
+<li><input type="checkbox" disabled="" />
+ordered unchecked</li>
+<li>[] plain item</li>
+<li><input type="checkbox" disabled="" checked="" />
+ordered checked</li>
+</ol>
+<p>paragraph</p>
+<ul>
+<li><p><input type="checkbox" disabled="" />
+list item with a</p><p>second paragraph</p></li>
+<li><p><input type="checkbox" disabled="" checked="" />
+checked</p></li>
+</ul>
+```
+
+latex task list test:
+
+```
+% pandoc -t latex
+- [ ] foo bar
+
+ baz
+
+- [x] ok
+^D
+\begin{itemize}
+\item[$\square$]
+ foo bar
+
+ baz
+\item[$\boxtimes$]
+ ok
+\end{itemize}
+```
+
+round trip:
+
+```
+% pandoc -f markdown -t markdown
+- [ ] foo
+- [x] bar
+^D
+- [ ] foo
+- [x] bar
+```
diff --git a/test/dokuwiki_external_images.dokuwiki b/test/dokuwiki_external_images.dokuwiki
index cc7eddcda..c835fa05b 100644
--- a/test/dokuwiki_external_images.dokuwiki
+++ b/test/dokuwiki_external_images.dokuwiki
@@ -1 +1 @@
-{{https://cooluri.com/image.png|HTTPS image}} {{http://cooluri.com/image.png|HTTP image}} {{ftp://ftp.cooluri.com/image.png|FTP image}} {{file:///tmp/coolimage.png|Filesystem image}} {{:/image.jpg|Relative image 1}} {{:image.jpg|Relative image 2}}
+{{https://cooluri.com/image.png|HTTPS image}} {{http://cooluri.com/image.png|HTTP image}} {{ftp://ftp.cooluri.com/image.png|FTP image}} {{file:///tmp/coolimage.png|Filesystem image}} {{/image.jpg|Relative image 1}} {{image.jpg|Relative image 2}}
diff --git a/test/writer.dokuwiki b/test/writer.dokuwiki
index 4ba1b7054..34f4246db 100644
--- a/test/writer.dokuwiki
+++ b/test/writer.dokuwiki
@@ -609,9 +609,9 @@ or here: <http://example.com/>
From “Voyage dans la Lune” by Georges Melies (1902):
-{{:lalune.jpg|Voyage dans la Lune lalune}}
+{{lalune.jpg|Voyage dans la Lune lalune}}
-Here is a movie {{:movie.jpg|movie}} icon.
+Here is a movie {{movie.jpg|movie}} icon.
----
diff --git a/test/writer.zimwiki b/test/writer.zimwiki
index 7783b836c..4b384fb20 100644
--- a/test/writer.zimwiki
+++ b/test/writer.zimwiki
@@ -593,9 +593,9 @@ or here: <http://example.com/>
From “Voyage dans la Lune” by Georges Melies (1902):
-{{:lalune.jpg|Voyage dans la Lune lalune}}
+{{lalune.jpg|Voyage dans la Lune lalune}}
-Here is a movie {{:movie.jpg|movie}} icon.
+Here is a movie {{movie.jpg|movie}} icon.
----