Skip to content

🐛 fix(render): handle formatter subclasses and wrap preformatted blocks#297

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:epilog
Mar 19, 2026
Merged

🐛 fix(render): handle formatter subclasses and wrap preformatted blocks#297
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:epilog

Conversation

@gaborbernat
Copy link
Member

Parsers using a custom formatter that inherits from RawDescriptionHelpFormatter (e.g. combining it with ArgumentDefaultsHelpFormatter) had their epilog and description rendered as a single collapsed paragraph. The formatter check used exact equality (==) instead of issubclass, so any subclass silently fell through to the plain-text path.

Preformatted blocks (usage, epilog, description) also rendered with white-space: pre in HTML, causing long lines to overflow their container with a horizontal scrollbar. 🔧 A small injected CSS file now applies pre-wrap to these blocks so text wraps naturally while preserving newlines and indentation.

@gaborbernat gaborbernat added the bug Something isn't working label Mar 19, 2026
The `RawDescriptionHelpFormatter` check used exact equality, so parsers
with a custom formatter inheriting from it (e.g. combining
`ArgumentDefaultsHelpFormatter` with `RawDescriptionHelpFormatter`)
would lose all newline formatting in epilog/description text.

Preformatted blocks (usage, epilog, description) also lacked text
wrapping in HTML, causing long lines to overflow their container
with a horizontal scrollbar instead of wrapping naturally.
@gaborbernat gaborbernat merged commit a8ad42a into tox-dev:main Mar 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant