From 5746b2c27dd81e6ddb130ebdea85d2b73cce90dc Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 17 Mar 2014 08:25:22 -0700 Subject: [PATCH] update --- main.rkt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.rkt b/main.rkt index 6ba4a2c..8e439a3 100644 --- a/main.rkt +++ b/main.rkt @@ -25,6 +25,7 @@ (require 'inner) ;; set the parser mode based on reader mode + ;; todo: this won't work with inline submodules (define parser-mode (if (equal? reader-mode world:reader-mode-auto) (let* ([file-ext-pattern (pregexp "\\w+$")] @@ -48,6 +49,10 @@ (define metas (make-hash (map meta-element->assoc meta-elements))) (values doc-without-metas metas)) + ;; if reader-here-path is undefined, it will become a proc courtesy of #%top + ;; therefore that's how we can detect if it's undefined + (define here-path (if (procedure? reader-here-path) "anonymous-module" reader-here-path)) + (define doc-txexpr (let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown) (apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw)