tweaks to Danny's Scribble changes
This commit is contained in:
parent
d926f89cbe
commit
130618e946
|
@ -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)
|
||||
|
|
|
@ -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)))])))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user