From 7debfa9aa2f19ea12345accc5b1213ef01f61f71 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Tue, 26 Mar 2024 15:31:35 +0200 Subject: Remove dead code, add comment --- main.scm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'main.scm') diff --git a/main.scm b/main.scm index c8feac5..150c3d4 100644 --- a/main.scm +++ b/main.scm @@ -57,10 +57,6 @@ (define cwd (decompose-pathname md-path)) - ;;(define wiki-image-irx "\\!\\[\\[(.+?)\\]\\]") - ;;(define (wiki-image-replace m) (format "![](/files/~A)" (submatch m))) - ;;(define result (pipe md (@ replace-all wiki-image-irx wiki-image-replace))) - ;; Matches markdown links (define irx "\\[(.+?)\\]\\((.+?)\\)") (define (link-replace m) @@ -68,13 +64,14 @@ (define link (submatch m 2)) ;; if link is absolute or external, leave as is. - ;; otherwise, normalize it to the current context + ;; otherwise, normalize it to the current directory context (define ret-link (if (or (substring=? "https://" link) (substring=? "/" link)) link ;; else (normalize-pathname (make-pathname cwd link)))) + ;; replace src-dir prefix with webroot prefix (define rooted (replace (format "^~A\\/?" src-dir) "/" ret-link)) (format "[~A](~A)" alt rooted)) -- cgit v1.3