mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-18 00:44:29 -05:00
[PR #1798] [MERGED] fix(book): wrap long URLs to stop horizontal page overflow #19218
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1798
Author: @farhan523
Created: 5/23/2026
Status: ✅ Merged
Merged: 5/27/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/book-long-url-horizontal-overflow📝 Commits (1)
cd910e4fix(book): wrap long URLs to stop horizontal page overflow📊 Changes
3 files changed (+47 additions, -0 deletions)
View changed files
📝
book/quarto/assets/styles/_base-styles.scss(+19 -0)📝
shared/styles/partials/_links.scss(+12 -0)📝
shared/styles/partials/_toc.scss(+16 -0)📄 Description
Summary
On reference-heavy chapters (e.g. vol1 training), long unbreakable tokens — paper hashes (
https://proceedings.neurips.cc/paper/2012/hash/6aca97005c68f1206823815f66102863-Abstract.html), arXiv ids, DOI suffixes — inside body links, column-margin notes, footnotes, callouts, and right-side TOC entries inflated the line box past their column width. That cascaded into page-level horizontal scroll on narrower viewports.Fix: add
overflow-wrap: anywhereto the globalarule and the TOC container so unbreakable tokens wrap inside their column instead of forcing the page wider.Where the change goes
book/quarto/assets/styles/_base-styles.scss— the volume builds (vol1 + vol2) use this file. It carries duplicated TOC/link rules and does not import the shared partials, so the fix has to be applied here directly.shared/styles/partials/_links.scssandshared/styles/partials/_toc.scss— the corresponding shared partials, for ecosystem sites that do consume them (site, tinytorch, labs, kits, instructors, slides, mlsysim docs). Defensive parity so the same regression doesn't reappear in those builds later.Why
anywhere(notbreak-word)Only
overflow-wrap: anywhereshrinks an element's min-content size, so flex/grid ancestors can actually narrow the column.break-wordwould still let the long URL define the column's min-content, and the overflow would persist on small viewports. Paired withmin-width: 0on the TOC container so the column is allowed to take the smaller size. Regular prose still breaks at word boundaries first; mid-token splits only kick in when nothing else fits.Test plan
/vol1/contents/vol1/training/training.html) on a narrow viewport (~375 px)._base-styles.scss).site/) for any regression.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.