summaryrefslogtreecommitdiff
path: root/src/creole_test_main.c
diff options
context:
space:
mode:
authorLinnnus <[email protected]>2024-02-17 02:41:43 +0100
committerLinnnus <[email protected]>2024-02-17 02:44:38 +0100
commitfd385801d115e8a0aa29ffb9b9e6ff215c34cc42 (patch)
treeb97e150911216848a2655f767f7e48ad9b9a681a /src/creole_test_main.c
parent0f60b5f74919b8841bf9d8a9658d031e4fc503d1 (diff)
fix(creole): Handle escapes properly
A faulty boolean expression was to blame. This patch also adds the necessary tests to prevent relapses (i forgot det technical term).
Diffstat (limited to 'src/creole_test_main.c')
-rw-r--r--src/creole_test_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/creole_test_main.c b/src/creole_test_main.c
index 334ba43..bae144b 100644
--- a/src/creole_test_main.c
+++ b/src/creole_test_main.c
@@ -136,6 +136,16 @@ struct {
.output = "<p>Bold and italics should <em>be\nable</em> to cross lines.</p>"
},
{
+ .name = "Emphasised URL",
+ .input = "//https://example.com//",
+ .output = "<p><em><a href=\"https://example.com\">https://example.com</a></em></p>"
+ },
+ { // I don't know that this is necessarily //correct// behavior... Let's document it anyways
+ .name = "Emphasised URL ending in slash",
+ .input = "//https://example.com///",
+ .output = "<p><em><a href=\"https://example.com\">https://example.com</a></em>/</p>"
+ },
+ {
.name = "Emphasis does not cross paragraph boundaries",
.input = "This text should //not\n\nbe emphased// as it crosses a paragraph boundary.",
.output = "<p>This text should //not</p>"
@@ -152,11 +162,21 @@ struct {
"<em>this should be an italic text</em>.</p>"
},
{
+ .name = "Escaped emphasis",
+ .input = "I //love double ~// slashes//!",
+ .output = "<p>I <em>love double // slashes</em>!</p>"
+ },
+ {
.name = "Bold",
.input = "**Strong**",
.output = "<p><strong>Strong</strong></p>"
},
{
+ .name = "Escaped bold",
+ .input = "**Strong ~** still strong**",
+ .output = "<p><strong>Strong ** still strong</strong></p>"
+ },
+ {
.name = "Nested bold/italic",
.input = "//**Strong and emphasized**//",
.output = "<p><em><strong>Strong and emphasized</strong></em></p>"