diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-26 15:31:35 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2024-03-26 21:25:10 +0200 |
| commit | 7debfa9aa2f19ea12345accc5b1213ef01f61f71 (patch) | |
| tree | d314555fd5b1c0e3fe944acf26b2dbd705735674 | |
| parent | b5be88122ca11a2d43ef989904d4b96f72a306c8 (diff) | |
Remove dead code, add comment
| -rw-r--r-- | main.scm | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -57,10 +57,6 @@ (define cwd (decompose-pathname md-path)) - ;;(define wiki-image-irx "\\!\\[\\[(.+?)\\]\\]") - ;;(define (wiki-image-replace m) (format "" (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)) |
