diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
index 81aee7e9..da014ad2 100644
--- a/collects/scribble/html-render.ss
+++ b/collects/scribble/html-render.ss
@@ -1008,7 +1008,10 @@
(loop (+ n 1) (cdr ds))]
[else n])))])
null))
- ,@(render-flow d part ri #f))
+ ,@(if (and (= 1 (length (flow-paragraphs d)))
+ (omitable-paragraph? (car (flow-paragraphs d))))
+ (render-content (paragraph-content (car (flow-paragraphs d))) part ri)
+ (render-flow d part ri #f)))
(loop (cdr ds) (cdr as) (cdr vas) #f)))]))))
`((table ([cellspacing "0"]
,@(if need-inline?
diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss
index bffe72fc..a926c89f 100644
--- a/collects/scribble/manual.ss
+++ b/collects/scribble/manual.ss
@@ -26,7 +26,7 @@
(define etc "etc.") ; so we can fix the latex space, one day
(define (to-flow e)
- (make-flow (list (make-paragraph (list e)))))
+ (make-flow (list (make-omitable-paragraph (list e)))))
(define spacer (hspace 1))
(define flow-spacer (to-flow spacer))
(define flow-empty-line (to-flow (tt 'nbsp)))
@@ -160,7 +160,7 @@
(list
(make-flow
(list
- (make-paragraph
+ (make-omitable-paragraph
(cons
spacer
(if lang?
@@ -213,7 +213,7 @@
(define (make-line str)
(let* ([line (indent (str->elts str))]
[line (list (make-element 'tt line))])
- (list (make-flow (list (make-paragraph line))))))
+ (list (make-flow (list (make-omitable-paragraph line))))))
(make-table #f (map make-line strs)))
(define-syntax-rule (indexed-scheme x)
@@ -850,7 +850,7 @@
[(_ spec-id desc ...)
#'(*defforms (quote-syntax/loc spec-id) null
'(spec-id)
- (list (lambda (x) (make-paragraph (list x))))
+ (list (lambda (x) (make-omitable-paragraph (list x))))
null
null
(lambda () (list desc ...)))]))
@@ -963,7 +963,7 @@
(if (= 1 (length content))
(let ([paras (append-map flow-paragraphs (car content))])
(if (andmap paragraph? paras)
- (list (make-paragraph (append-map paragraph-content paras)))
+ (list (make-omitable-paragraph (append-map paragraph-content paras)))
(list (make-table style content))))
(list (make-table style content))))
@@ -1483,7 +1483,7 @@
(if (and (short-width . < . max-proto-width)
(not immutable?)
(not transparent?))
- (make-paragraph
+ (make-omitable-paragraph
(list
(to-element
`(,(schemeparenfont "struct")
@@ -1595,7 +1595,7 @@
(list
(make-flow
(list
- (make-paragraph
+ (make-omitable-paragraph
(list
(let ([target-maker
((if form? id-to-form-target-maker id-to-target-maker)
@@ -1621,7 +1621,7 @@
spacer ":" spacer))))
(make-flow (list (if (block? result-contract)
result-contract
- (make-paragraph (list result-contract)))))))))))
+ (make-omitable-paragraph (list result-contract)))))))))))
stx-ids names result-contracts))
(content-thunk))
null))
@@ -1653,7 +1653,7 @@
(list
((or form-proc
(lambda (x)
- (make-paragraph
+ (make-omitable-paragraph
(list (to-element `(,x . ,(cdr form)))))))
(and kw-id
(eq? form (car forms))
@@ -1717,7 +1717,7 @@
(list
(if form-thunk
(form-thunk)
- (make-paragraph (list (to-element form)))))))
+ (make-omitable-paragraph (list (to-element form)))))))
(if (null? sub-procs)
null
(list (list flow-empty-line)
@@ -2112,7 +2112,7 @@
(list
(list (make-flow
(list
- (make-paragraph
+ (make-omitable-paragraph
(list (let ([target-maker (id-to-target-maker stx-id #t)]
[content (list (annote-exporting-library
(to-element stx-id)))])
@@ -2156,7 +2156,7 @@
#f
(cons
(list (make-flow
- (list (make-paragraph
+ (list (make-omitable-paragraph
(list (hspace 2)
(case kind
[(interface) "implements:"]
diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss
index dba8b5f8..927767df 100644
--- a/collects/scribble/scheme.ss
+++ b/collects/scribble/scheme.ss
@@ -186,7 +186,7 @@
[line (or (syntax-line first) 0)])
(define (finish-line!)
(when multi-line?
- (set! docs (cons (make-flow (list (make-paragraph (reverse content))))
+ (set! docs (cons (make-flow (list (make-omitable-paragraph (reverse content))))
docs))
(set! content null)))
(define out
diff --git a/collects/scribble/struct.ss b/collects/scribble/struct.ss
index a6ae47e1..8dc62029 100644
--- a/collects/scribble/struct.ss
+++ b/collects/scribble/struct.ss
@@ -141,6 +141,7 @@
[flow ([paragraphs (listof block?)])]
[paragraph ([content list?])]
[(styled-paragraph paragraph) ([style any/c])]
+ [(omitable-paragraph paragraph) ()]
[table ([style any/c]
[flowss (listof (listof (or/c flow? (one-of/c 'cont))))])]
[(auxiliary-table table) ()]
diff --git a/collects/scribblings/scribble/struct.scrbl b/collects/scribblings/scribble/struct.scrbl
index 8923b1e5..474cf659 100644
--- a/collects/scribblings/scribble/struct.scrbl
+++ b/collects/scribblings/scribble/struct.scrbl
@@ -334,6 +334,15 @@ A @techlink{paragraph} has a list of @tech{elements}.
}
+@defstruct[(omitable-paragraph paragraph) ()]{
+
+Equivalent to a @scheme[paragraph], except that when a table cell
+contains a single @scheme[omitable-paragraph], then when rendering to
+HTML, no @tt{p} tag wraps the cell content.
+
+}
+
+
@defstruct[(styled-paragraph paragraph) ([style any/c])]{
The @scheme[style] can be