diff --git a/collects/scribble/core.rkt b/collects/scribble/core.rkt index 8789b715..5fefcc0d 100644 --- 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 index 7fd12bf9..8b083f77 100644 --- 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)