Skip to content

Utilities/Sphinx: Improve word wrap of signatures

Implement logic to support several styles of parsing in the new signature directive that control where line breaks are allowed in a signature.

The default is 'smart', which forbids breaks inside of square- or angle-brackets. The 'verbatim' option forbids all breaks. In all cases, breaks are always allowed where a newline appears in the source.

This seems to Just Work for most writers, but HTML needs some special handling that is accomplished by a new CSS rule and assigning the 'nbsp' class to spaces that are not allowed to break. (ROFF's line wrapping is rather unfortunate here, as it prefers splitting and hyphenating words rather than breaking at a space.)

Merge request reports