racket/scribble

`result` puts block elements inside paragraph element.

Opened this issue · 0 comments

result puts block level elements inside p elements causing incorrect rendering as the opening div tag automatically closes the p element (image below) this results in a blank line of height 1.4. (second image below)

The result function is defined in https://github.com/racket/scribble/blob/master/scribble-doc/scribblings/scribble/how-to-paper.scrbl as @(define (result . text) (apply nested #:style 'inset text)). (I'm having trouble working out where nested is defined)

The P element represents a paragraph. It cannot contain block-level elements (including P itself).

We discourage authors from using empty P elements. User agents should ignore empty P elements.

From html reference: https://www.w3.org/TR/html401/struct/text.html#h-9.3.1

   @result{
       If a mouse eats all your cookies, put up a sign that says
       @centered{
         @bold{Cookies Wanted}
         
         @italic{Chocolate chip preferred!}
       }
       and see if anyone brings you more.
   }

renders as

            <blockquote>
                <p>
                <div class="SIntrapara">If a mouse eats all your cookies, put up a sign that says
                </div>
                <div class="SIntrapara">
                    <blockquote class="SCentered">
                        <p>
                            <span style="font-weight: bold">Cookies Wanted</span>
                        </p>
                        <p>
                            <span style="font-style: italic">Chocolate chip preferred!</span>
                        </p>
                    </blockquote>
                </div>
                <div class="SIntrapara">and see if anyone brings you more.</div>
                </p>
            </blockquote>

image
image