cripslock

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit af459e8a7296e9270d191ee64a3e0647cb36fb68
parent 506f79111bd3b44c6c5d7d743d54d074a2f40e84
Author: Daniel Barlow <dan@telent.net>
Date:   Mon, 21 Jul 2025 12:59:44 +0100

textile: parse links at end of para

Diffstat:
Atests/link.textile | 1+
Mtextile.fnl | 7++++---
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/link.textile b/tests/link.textile @@ -0,0 +1 @@ +"example":https://www.example.com diff --git a/textile.fnl b/textile.fnl @@ -92,7 +92,7 @@ "\"" (fn [f str] (let [(title url unparsed) - (string.match str "^\"(.-)\":(%g+)(%G+.+)$")] + (string.match str "^\"(.-)\":(%g+)%f[%G](.*)$")] (if title (values (doto (f title) @@ -161,7 +161,7 @@ (expect= (inline-markup "see \"a link\":https://www.example.com for more") ["see " [["a" {:href "https://www.example.com"}] "a link"] " for more"]) - (expect= (inline-markup "see \"a link\":https://www.example.com\nfor more") + (expect= (inline-markup "see \"a link\":https://www.example.com\nfor more") ["see " [["a" {:href "https://www.example.com"}] "a link"] "\nfor more"]) @@ -281,7 +281,7 @@ (.. s " " (string.format "%s=%q" name value)))) name (values name ""))] - (out-stream:write (string.format "<%s %s>" name attrstring)) + (out-stream:write (string.format "<%s%s>" name attrstring)) (each [_ child (ipairs content)] (to-html out-stream child)) (out-stream:write (string.format "</%s>" name))))) @@ -297,6 +297,7 @@ (out:read "*a")))) (expect= (convert "tests/hello.txt") "<p>hello world\n</p>") + (expect= (convert "tests/link.textile") "<p><a href=\"https://www.example.com\">example</a>\n</p>") (expect= (convert "tests/blog.textile") "<h1>header 1 </h1><p>This is the first para