commit fff0e46c881ebacf6c73dfea328a5895d95eb371
parent dc3a087b5c896810d4bac0d9d6acd96d26fd8310
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 22 Jul 2025 21:27:12 +0100
bugfix textile link parsing
Diffstat:
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/textile.fnl b/textile.fnl
@@ -93,13 +93,13 @@
"\"" (fn [f str]
(let [(title url unparsed)
- (string.match str "^\"(.-)\":(%g+)%f[%G](.*)$")]
+ (string.match str "^\"([^\"]-)\":(%g+)%f[%G](.*)$")]
(if title
(values
(doto (f title)
(table.insert 1 [:a {:href url} ]))
unparsed)
- (values str "")
+ (values "\"" (string.sub str 2))
)))
;; this one must be last
"-" (scan-tok "-" :del)
@@ -151,7 +151,7 @@
(expect= (inline-markup "foo @ example.com") ["foo @ example.com" ])
(expect= (inline-markup "say \"hello\" to my friend")
- ["say " "\"hello\" to my friend"])
+ ["say " "\"" "hello\" to my friend"])
(expect= (inline-markup "foo *strong*") ["foo " [:strong "strong"]])
@@ -171,6 +171,23 @@
["see " [["a" {:href "https://www.example.com"}] "a link"] "\nfor more"])
+ (expect= (inline-markup "when doing
+a \"development\" build, now we make a single agglomerated firmware
+image and rely on the \"kernel mtdsplit
+code\":https://ww.telent.net/2018/4/16/flash_ah_ah to find the root
+filesystem. ")
+ ["when doing
+a "
+ "\""
+ "development\" build, now we make a single agglomerated firmware
+image and rely on the "
+ [["a" {:href "https://ww.telent.net/2018/4/16/flash_ah_ah"}]
+ "kernel mtdsplit
+code"]
+ " to find the root
+filesystem. "])
+
+
)