pradyunsg / furo

A clean customizable documentation theme for Sphinx
https://pradyunsg.me/furo/quickstart
MIT License
2.76k stars 317 forks source link

Break long inline code literals #553

Closed imphil closed 1 year ago

imphil commented 2 years ago

Inline code is currently only broken on "normal" word break opportunities. Unfortunately, it depends on the browser engine what "normal" word break opportunities mean. This becomes very visible in a typical example for a long inline string: a long Unix-style path or an URL. Firefox considers a slash ("/") a word break opportunity, while Chrome doesn't.

To keep documentation readable we need to break long inline code literals, otherwise they expand beyond the viewport where they are of little use to the reader.

Introducing "overflow-wrap: break-word" gives us line-breaking in all browsers, even though the rendered result will differ depending on the browser in question.

Before

Chrome

before-chrome

Firefox

before-firefox

After

Chrome

after-chrome

Firefox

after-firefox

imphil commented 1 year ago

Review ping @pradyunsg

pradyunsg commented 1 year ago

Thanks @imphil! ^.^