From fd385801d115e8a0aa29ffb9b9e6ff215c34cc42 Mon Sep 17 00:00:00 2001
From: Linnnus
Date: Sat, 17 Feb 2024 02:41:43 +0100
Subject: 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).
---
src/creole_test_main.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
(limited to 'src/creole_test_main.c')
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
@@ -135,6 +135,16 @@ struct {
.input = "Bold and italics should //be\nable// to cross lines.",
.output = "Bold and italics should be\nable to cross lines.
"
},
+ {
+ .name = "Emphasised URL",
+ .input = "//https://example.com//",
+ .output = "https://example.com
"
+ },
+ { // 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 = "https://example.com/
"
+ },
{
.name = "Emphasis does not cross paragraph boundaries",
.input = "This text should //not\n\nbe emphased// as it crosses a paragraph boundary.",
@@ -151,11 +161,21 @@ struct {
"http://www.wikicreole.org. This is what can go wrong "
"this should be an italic text.
"
},
+ {
+ .name = "Escaped emphasis",
+ .input = "I //love double ~// slashes//!",
+ .output = "I love double // slashes!
"
+ },
{
.name = "Bold",
.input = "**Strong**",
.output = "Strong
"
},
+ {
+ .name = "Escaped bold",
+ .input = "**Strong ~** still strong**",
+ .output = "Strong ** still strong
"
+ },
{
.name = "Nested bold/italic",
.input = "//**Strong and emphasized**//",
--
cgit v1.2.3