diff --git a/main.scm b/main.scm index 39d0a3c..5b71f4d 100755 --- a/main.scm +++ b/main.scm @@ -90,21 +90,33 @@ string-block (define (display-source-html source-file) ;; src/main.scm (format #t "
~a
" source-file) - (case (string->symbol (or (pathname-extension source-file) "")) + (case (string->symbol (or (pathname-extension source-file) "no-extension")) ((md markdown) - (markdown->html (git-file->string source-file))) + (handle-exceptions exn + (begin + (display "Error parsing " (current-error-port)) + (display source-file (current-error-port)) + (display "\n" (current-error-port)) + (display "There was an error parsing this file as Markdown.
") + (display "") + (display-escaped-html (git-file->string source-file)) + (display "")) + (markdown->html (git-file->string source-file)))) ((jpg jpeg png gif webp webm apng avif svgz ico) - (format #t "" source-file) - ) + (format #t "" source-file)) ((svg) (format #t "" source-file) (display "
") (display-escaped-html (git-file->string source-file)) (display "")) - (else + ((gz pack idx) + (display "
(Binary file)
")) + ((txt no-extension) (display "") (display-escaped-html (git-file->string source-file)) - (display "")))) + (display "")) + (else + (display "
(Unknown file type)
")))) (define (display-files-html source-files-list) (display "