racket / racket/scribble

`result` puts block elements inside paragraph element.

Open
#243 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
250
Forks
102
Avg merge
11d 11h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in scribble-doc/scribblings/scribble/how-to-paper.scrbl at the definition of result, then locate the nested implementation as the issue suggests. Reproduce the shown result example and inspect the generated HTML; done means block elements are no longer placed inside a p element and the extra blank line is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.