bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2c7e58dd7010f7738b432ccb3c803ef67e20f773
parent 31c6e16944ec22dc311ca22d6681d9657d952c65
Author: Matthew Flatt <mflatt@racket-lang.org>
Date:   Thu, 28 Jun 2012 08:57:58 -0600

tweaks to Danny's Scribble changes

original commit: 130618e946640d749a81312fa951acd43ec1c66a

Diffstat:
Mcollects/scribble/core.rkt | 24++++++++++++++++++------
Mcollects/scribble/decode.rkt | 3++-
2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/collects/scribble/core.rkt b/collects/scribble/core.rkt @@ -584,16 +584,28 @@ (content->port op (part-relative-element-content c ri) renderer sec ri)] [else (content->port op c)])])) +(define (simple-content->string c) + ;; `content->string' is commonly used on a list containing a single string + (cond + [(string? c) c] + [(and (pair? c) + (string? (car c)) + (null? (cdr c))) + (car c)] + [else #f])) + (define content->string (case-lambda [(c) - (define op (open-output-string)) - (content->port op c) - (get-output-string op)] + (or (simple-content->string c) + (let ([op (open-output-string)]) + (content->port op c) + (get-output-string op)))] [(c renderer sec ri) - (define op (open-output-string)) - (content->port op c renderer sec ri) - (get-output-string op)])) + (or (simple-content->string c) + (let ([op (open-output-string)]) + (content->port op c renderer sec ri) + (get-output-string op)))])) (define (aux-element? e) diff --git a/collects/scribble/decode.rkt b/collects/scribble/decode.rkt @@ -109,8 +109,9 @@ [(string=? the-match "'") 'rsquo]) (loop (cdar m))))] ;; Common case: nothing to decode, so don't copy strings. + ;; Assume that the input is already interned. [(= start 0) - (list (datum-intern-literal s))] + (list s)] [else (list (datum-intern-literal (substring s start)))])))