summaryrefslogtreecommitdiffstats
path: root/main.scm
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2024-03-26 15:31:35 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2024-03-26 21:25:10 +0200
commit7debfa9aa2f19ea12345accc5b1213ef01f61f71 (patch)
treed314555fd5b1c0e3fe944acf26b2dbd705735674 /main.scm
parentb5be88122ca11a2d43ef989904d4b96f72a306c8 (diff)
Remove dead code, add comment
Diffstat (limited to 'main.scm')
-rw-r--r--main.scm7
1 files changed, 2 insertions, 5 deletions
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))