pull/9/head
Matthew Butterick 11 years ago
parent 47dd531f04
commit 5746b2c27d

@ -25,6 +25,7 @@
(require 'inner) (require 'inner)
;; set the parser mode based on reader mode ;; set the parser mode based on reader mode
;; todo: this won't work with inline submodules
(define parser-mode (define parser-mode
(if (equal? reader-mode world:reader-mode-auto) (if (equal? reader-mode world:reader-mode-auto)
(let* ([file-ext-pattern (pregexp "\\w+$")] (let* ([file-ext-pattern (pregexp "\\w+$")]
@ -48,6 +49,10 @@
(define metas (make-hash (map meta-element->assoc meta-elements))) (define metas (make-hash (map meta-element->assoc meta-elements)))
(values doc-without-metas metas)) (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 (define doc-txexpr
(let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown) (let ([doc-raw (if (equal? parser-mode world:reader-mode-markdown)
(apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw) (apply (compose1 (dynamic-require 'markdown 'parse-markdown) string-append) doc-raw)

Loading…
Cancel
Save