commit d5e244a068b98d087a69ff62a727ce2e43d89d86 parent 2eb3c62bd6ce3667fdcaa5125be42dbead5c123f Author: Matthew Flatt <mflatt@racket-lang.org> Date: Mon, 2 Feb 2015 21:28:45 +0100 Fix `#:redirect-main`/`--redirect-main` for only main installation The intent was for the redirection to apply only to links to documentation in the main installation, but it also affected other paths. Diffstat:
| M | scribble-lib/scribble/html-render.rkt | | | 13 | +++++++++---- |
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scribble-lib/scribble/html-render.rkt b/scribble-lib/scribble/html-render.rkt @@ -1336,10 +1336,15 @@ `((a ([href ,(cond [(and ext-id external-root-url - (let ([rel (find-relative-path - (find-doc-dir) - (relative->path (dest-path dest)))]) - (and (relative-path? rel) + (let* ([ref-path (relative->path (dest-path dest))] + [rel (if (relative-path? ref-path) + #f + (find-relative-path + (find-doc-dir) + ref-path))]) + (and rel + (relative-path? rel) + (not (memq 'up (explode-path rel))) rel))) => (lambda (rel) (url->string*