Skip Navigation
EnumerationEnumeration

WordBreak

Safe places to break long names across lines, like swift-docc-render’s WordBreak.

enum WordBreak

Overview

Long symbol names, such as init(basePackage:prefix:packagePrefixes:), contain no spaces, so a browser would otherwise break them between arbitrary characters on a narrow screen. The markup marks the boundaries swift-docc-render uses with <wbr> elements, so that names break at readable places when they do not fit:

  • between a lower case and an upper case letter (foo<wbr>Bar),

  • after a colon that is followed by a word character (x:<wbr>y:),

  • before a dot or an underscore between word characters (Foo<wbr>.Bar).

Only ASCII letters, digits and the underscore count as word characters.

Topics