commit 77d079a3edb316ffc9584816a29f4974a0765c7a
parent 871a61581ce86f5de17c6bfa7d8affbbacb76833
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Tue, 19 Feb 2013 13:59:10 -0700
scribble: fix 'aux stripping for hyperlinks and HTML titles
original commit: ce960756cbea2fa1bafdc0497bb558af851596f6
Diffstat:
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/collects/scribble/core.rkt b/collects/scribble/core.rkt
@@ -619,14 +619,24 @@
(define (aux-element? e)
(and (element? e)
(let ([s (element-style e)])
- (and (style? e)
+ (and (style? s)
(memq 'aux (style-properties s))))))
(define (strip-aux content)
(cond
[(null? content) null]
[(aux-element? content) null]
- [(list? content) (map strip-aux content)]
+ [(element? content)
+ (define c (element-content content))
+ (define p (strip-aux c))
+ (if (equal? c p)
+ content
+ (struct-copy element content [content p]))]
+ [(list? content)
+ (define p (map strip-aux content))
+ (if (equal? p content)
+ content
+ p)]
[else content]))
;; ----------------------------------------
diff --git a/collects/scribble/html-render.rkt b/collects/scribble/html-render.rkt
@@ -667,7 +667,7 @@
[title (cond [(part-title-content d)
=> (lambda (c)
`(title ,@(format-number number '(nbsp))
- ,(content->string c this d ri)))]
+ ,(content->string (strip-aux c) this d ri)))]
[else `(title)])])
(unless (bytes? style-file)
(unless (lookup-path style-file alt-paths)