summaryrefslogtreecommitdiff
path: root/src/creole-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/creole-test.c')
-rw-r--r--src/creole-test.c45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/creole-test.c b/src/creole-test.c
index 50ccd8b..c5b6590 100644
--- a/src/creole-test.c
+++ b/src/creole-test.c
@@ -55,6 +55,41 @@ struct {
.input = "======= Header =",
.output = "<p>======= Header =</p>"
},
+ {
+ .name = "Unnamed link",
+ .input = "[[MyPage]]",
+ .output = "<p><a href=\"MyPage\">MyPage</a></p>"
+ },
+ {
+ .name = "Named link",
+ .input = "[[MyPage|My page]]",
+ .output = "<p><a href=\"MyPage\">My page</a></p>"
+ },
+ {
+ .name = "Escaped link",
+ .input = "A paragraph with an ~[[escaped link]].",
+ .output = "<p>A paragraph with an [[escaped link]].</p>"
+ },
+ {
+ .name = "Link with an escaped end",
+ .input = "[[https://example.com|A link with an escaped ~]] end]]",
+ .output = "<p><a href=\"https://example.com\">A link with an escaped ]] end</a></p>"
+ },
+ {
+ .name = "Link with empty text",
+ .input = "[[https://example.com|]]",
+ .output = "<p><a href=\"https://example.com\"></a></p>"
+ },
+ {
+ .name = "Link with empty address",
+ .input = "[[|Hello]]",
+ .output = "<p><a href=\"\">Hello</a></p>"
+ },
+ {
+ .name = "Empty link",
+ .input = "[[]]",
+ .output = "<p><a href=\"\"></a></p>"
+ },
#if 0
{
.name = "Simple unordered list",
@@ -132,16 +167,6 @@ struct {
"<a href=\"http //example.com/examplepage\">Example Page</a></p>"
},
{
- .name = "Unnamed link",
- .input = "[[MyPage]]",
- .output = "<p><a href=\"MyPage\">MyPage</a></p>"
- },
- {
- .name = "Named link",
- .input = "[[MyPage|My page]]",
- .output = "<p><a href=\"MyPage\">My page</a></p>"
- },
- {
.name = "Image",
.input = "{{image.gif|my image}}",
.output = "<p><img src=\"image.gif\" alt=\"my image\"/></p>"