Policy text is unreadable at acceptance when written without HTML #127

Closed
opened 2026-07-28 20:03:45 +00:00 by thatguygriff · 0 comments
Owner

Reported

A studio reported that the policy shown at acceptance was unreadable: the whole policy rendered on one tiny line, words piling on top of each other, with a horizontal scrollbar.

Cause

Two problems compounding, both hit hardest when the policy was typed as plain prose with no HTML — which is the normal way to write one, since the admin field is a bare textarea.

  1. No block markup, no paragraphs. The body was emitted verbatim into the page, so blank lines between paragraphs collapsed and the entire policy became a single unbroken run of text. Nothing applied the wpautop() treatment WordPress gives post content.
  2. .us-policy-body had no CSS at all. The container inherited whatever the active theme did with an unstyled block inside a form — hence the overlapping lines and the horizontal scrollbar. There was no wrapping rule, no line-height, and no height bound, so a long policy could also push the "I have read and agree" checkbox out of view.

There is a third, related gap: RegistrationPage never enqueues assets/css/frontend.css, unlike BookingPage and GroupClassPage. Even once the stylesheet gained rules for this markup, the signup gate would not have received them.

Wanted

  • Policy bodies rendered through one shared path that formats unmarked-up text into real paragraphs and leaves bodies that do carry markup alone. It must cover all three consumers: GET /policies (booking and enrolment JS), the signup form, and the admin version viewer.
  • Real styling for .us-policy / .us-policy-body: a bounded reading box that scrolls vertically, wraps long tokens (a pasted URL must not force the page sideways), and keeps the accept checkbox reachable.
  • The stylesheet enqueued on the registration page.

Sanitising must stay where it is — bodies are wp_kses_post()-ed on write and again at output, since the booking JS injects this HTML raw.

## Reported A studio reported that the policy shown at acceptance was unreadable: the whole policy rendered on one tiny line, words piling on top of each other, with a horizontal scrollbar. ## Cause Two problems compounding, both hit hardest when the policy was typed as plain prose with no HTML — which is the normal way to write one, since the admin field is a bare textarea. 1. **No block markup, no paragraphs.** The body was emitted verbatim into the page, so blank lines between paragraphs collapsed and the entire policy became a single unbroken run of text. Nothing applied the `wpautop()` treatment WordPress gives post content. 2. **`.us-policy-body` had no CSS at all.** The container inherited whatever the active theme did with an unstyled block inside a form — hence the overlapping lines and the horizontal scrollbar. There was no wrapping rule, no line-height, and no height bound, so a long policy could also push the "I have read and agree" checkbox out of view. There is a third, related gap: `RegistrationPage` never enqueues `assets/css/frontend.css`, unlike `BookingPage` and `GroupClassPage`. Even once the stylesheet gained rules for this markup, the signup gate would not have received them. ## Wanted - Policy bodies rendered through one shared path that formats unmarked-up text into real paragraphs and leaves bodies that do carry markup alone. It must cover all three consumers: `GET /policies` (booking and enrolment JS), the signup form, and the admin version viewer. - Real styling for `.us-policy` / `.us-policy-body`: a bounded reading box that scrolls vertically, wraps long tokens (a pasted URL must not force the page sideways), and keeps the accept checkbox reachable. - The stylesheet enqueued on the registration page. Sanitising must stay where it is — bodies are `wp_kses_post()`-ed on write and again at output, since the booking JS injects this HTML raw.
thatguygriff added the bug label 2026-07-28 20:03:45 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#127