Soft hyphen
63 sites
Security covered
This module allows you to add soft hyphens to plain text fields in Drupal. Soft hyphens tell browsers where a word can be broken to improve the display of long words, especially on smaller screens. It can be enabled in field display settings or used in Twig templates.
Use soft hyphen (­) HTML tag in Text (plain) and Text (plain, long) fields (eg. title).
Usage on UI
- Create your field (in type of Text (plain) or Text (plain, long) )
- Check Enable soft hyphen checkbox on Manage display tab on given field Plain text field formatter setting.
- Fill your field data like this:
Lorem­Ipsumissimply dummy­textoftheprinting and typesetting industry.
Usage on twig file
You can use shy twig filter in twig file {{ field_name|shy }}
Similar module
Background
There is a nice article from Tamás Hajas about this topic, https://integralvision.eu/en/blog/long-words-case-browser