Skip to content

Preformatted text may wrap at any place. #2071

@gmilde

Description

@gmilde

common.css contains the settings:

white-space: pre-wrap; 
word-wrap: break-word; 
word-break: break-all;

in the rules for both, .code and pre.
This mimics the behaviour of an x-terminal or console.

  • This may be suited for an IRC log (wiki.local:help-en/OtherTextItems#IRC_Log).
  • It is problematic for source code in a language with "semantic indentation" like Python
    or reStructuredText (wiki.local:help-en/OtherTextItems#Python)
  • It is fatal to ASCII art, e.g., the documentation of "grid tables" for the rST converter.
    (wiki.local:help-en/rst#Grid_Tables)

The settings for .code also include a padding and frame that looks strange and leads to overlap and obstructuion when inline code is wrapped (wiki.local:help-en/rst#Text_formatting).

Suggestion:

  • Use white-space: pre and overflow: auto for both, pre.code and pre.
  • Define a new user style .wrap that can be applied to, e.g., a full-width IRC Log.
    Different rules for wrap and pre.wrap could care for different handling of normal vs. pre-formatted text. (Consider using overflow-wrap instead of the legacy alias word-break.)
  • Use a different style for code blocks (pre.code) and inline code (code, .code) with less padding and no frame for inline code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions