diff --git a/collects/scribble/base-render.ss b/collects/scribble/base-render.ss index 995509a5..eb2154c3 100644 --- a/collects/scribble/base-render.ss +++ b/collects/scribble/base-render.ss @@ -34,14 +34,6 @@ (substring s 0 (sub1 (string-length s)))) sep))) - (define/public (strip-aux content) - (cond - [(null? content) null] - [(aux-element? (car content)) - (strip-aux (cdr content))] - [else (cons (car content) - (strip-aux (cdr content)))])) - ;; ---------------------------------------- ;; marshal info diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index 54404576..b74aad41 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -63,7 +63,6 @@ install-file get-dest-directory format-number - strip-aux quiet-table-of-contents) (define/override (get-suffix) #".html") diff --git a/collects/scribble/struct.ss b/collects/scribble/struct.ss index c3a24062..800125a2 100644 --- a/collects/scribble/struct.ss +++ b/collects/scribble/struct.ss @@ -270,7 +270,8 @@ ;; ---------------------------------------- (provide content->string - element->string) + element->string + strip-aux) (define content->string (case-lambda @@ -297,12 +298,26 @@ [else (format "~s" c)])])] [(c renderer sec ri) (cond + [(and (link-element? c) + (null? (element-content c))) + (let ([dest (resolve-get sec ri (link-element-tag c))]) + (if dest + (content->string (strip-aux (cadr dest)) renderer sec ri) + "???"))] [(element? c) (content->string (element-content c) renderer sec ri)] [(delayed-element? c) (content->string (delayed-element-content c ri) renderer sec ri)] [else (element->string c)])])) + (define (strip-aux content) + (cond + [(null? content) null] + [(aux-element? (car content)) + (strip-aux (cdr content))] + [else (cons (car content) + (strip-aux (cdr content)))])) + ;; ---------------------------------------- (provide flow-element-width diff --git a/collects/scribblings/scribble/struct.scrbl b/collects/scribblings/scribble/struct.scrbl index 54b60d61..848226d3 100644 --- a/collects/scribblings/scribble/struct.scrbl +++ b/collects/scribblings/scribble/struct.scrbl @@ -453,7 +453,7 @@ A placeholder for a tag to be generated during the @scheme{collect @defproc*[([(content->string (content list?)) string?] - [(content->string (content list?) (p part?) (info resolve-info?)) string?])]{ + [(content->string (content list?) (renderer any/c) (p part?) (info resolve-info?)) string?])]{ Converts a list of elements to a single string (essentially rendering the content as ``plain text''). @@ -465,7 +465,7 @@ element (if it has not been forced already).} @defproc*[([(element->string (element any/c)) string?] - [(element->string (element any/c) (p part?) (info resolve-info?)) string?])]{ + [(element->string (element any/c) (renderer any/c) (p part?) (info resolve-info?)) string?])]{ Like @scheme[content->string], but for a single element. }