#13683·openlibrary

Fix it so long strings don't cause the page to get wider on mobile

Author: RayBBCreated Sep 20, 2026Updated Sep 24, 2026
LabelsType: BugPriority: 3Good First IssueAffects: UIAffects: Mobile/ResponsiveNeeds: ResponseLead: @lokeshModule: CSS

Problem

https://openlibrary.org/help/faq/editing

Probably one line of CSS we need to update.

Image

Reproducing the bug

  1. Open https://openlibrary.org/help/faq/editing on a phone, or at a 375px-wide viewport in devtools
  2. Scroll down to the list of example work URLs
  • Expected behavior: long strings wrap inside the content column, and the page doesn't scroll sideways.
  • Actual behavior: Moon_is_Down_Of_Mice_and_Men_Pearl_Red_Pony_Tortilla… runs off the edge, which makes the whole page (header included) wider than the viewport.

Context

  • Browser (Chrome, Safari, Firefox, etc): any (mobile)
  • OS (Windows, Mac, etc):
  • Logged in (Y/N):
  • Environment (prod, dev, local): prod

Breakdown

Implementation Details (for maintainers)

Cause. Two things combine:

  1. The only wrap rule for wiki pages is div#contentBody p a { word-wrap: break-word; }, so it only covers links inside paragraphs. Plain text, list items, headings, etc. don't wrap.
  2. On this page, the URL https://openlibrary.org/works/OL23185W/The_Short_Novels_of_John_Steinbeck_(Cannery_Row_… contains parentheses, which break the markdown link. The link ends partway through, and the rest renders as unlinked plain text. Rule 1 doesn't cover plain text, so it overflows.

Fix. Make wrapping apply to the whole content container instead of just p a:

css
div.contentBody,
div#contentBody {
  overflow-wrap: break-word;
}

Then remove the now-redundant p a rule. break-word only breaks a string that can't fit on its own line, so normal text on other pages is unaffected.

Requirements Checklist

  • Replace the div#contentBody p a / div.contentBody p a rule in static/css/layout/index.css with overflow-wrap: break-word on div#contentBody, div.contentBody
  • Verify at a 375px viewport that /help/faq/editing no longer scrolls horizontally (include before/after screenshots in the PR)
  • Spot-check a few other pages that use the same template (/about, /help, another /help/faq/* page) for regressions
  • (Maintainer, separate from the PR) Fix the malformed links on /help/faq/editing itself (the OL23185W and OL17592217W examples) by editing the page source via ?m=edit

Related files

  • static/css/layout/index.css (the #contentBody rules, ~L55-66)
  • openlibrary/templates/type/page/view.html (wraps wiki page bodies in #contentBody)

Stakeholders

  • @lokesh

Instructions for Contributors

  • Please run these commands to ensure your repository is up to date before creating a new branch to work on this issue and each time after pushing code to Github, because the pre-commit bot may add commits to your PRs upstream.

Source: internetarchive/openlibrary