heimrichhannot / contao-hyphenator-bundle
Word-Hyphenation for the contao content-management-system.
Installs: 1 427
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 1
Open Issues: 4
Type:contao-bundle
Requires
- php: ^7.1 || ^8.0
- contao/core-bundle: ^4.4
- heimrichhannot/contao-multi-column-editor-bundle: ^2.0
- heimrichhannot/contao-utils-bundle: ^2.16
- vanderlee/syllable: ^1.5
- wa72/htmlpagedom: ^1.3 || ^2.0
Requires (Dev)
- contao/manager-plugin: ^2.0
- contao/test-case: 1.1.* || ^2 || ^3 || ^4
- friendsofphp/php-cs-fixer: ^2.2
- php-coveralls/php-coveralls: ^2.0
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/phpunit: ^6.0 || ^7.0 || ^8.0
- symfony/phpunit-bridge: ^3.2
- dev-master
- 1.11.4
- 1.11.3
- 1.11.2
- 1.11.1
- 1.11.0
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.1
- 1.0.0
- dev-contao5
- dev-feature/configure-skipp-html-tags
This package is auto-updated.
Last update: 2024-11-02 09:50:33 UTC
README
A contao bundle that grants server-side hyphenation (thanks to vanderlee/phpSyllable). It does support headlines and paragraphs by default.
This module also handles line break exceptions, in order to keep words like company names together and prevent line break (see tl_page
backend entity).
Options
To extend the functionality, all options can be adjusted within your localconfig.
Skip hyphenation
If you want to skip several tags from hyphenation simply add hyphen-none
as css-class to the appropriate element or use the tl_page.hyphenation
field.
You also can add tags to be skipped to your project configuration. See configuration reference below
Configuration reference
# Default configuration for extension with alias: "huh_hyphenator" huh_hyphenator: # Add tags you want to be skipped from hyphenating, to array (string without <>) skip_tags: []
Line break exceptions
Hyphenator comes with line break exception handling.
Simply add lineBreakExceptions
on tl_page
and prevent line break for connected word groups like:
- Company Names (search:
Heimrich & Hannot(?:\sGmbH)|Heimrich & Hannot(?:s)?
, will be replaced to:<span class="text-nowrap">Heimrich & Hannot GmbH</span>
) - Prices and other units (search:
(\d|€)(\s)(\w)
, replace:$1[nbsp]$3
, Example:160.000 m²
->160.00<span class="text-nowrap">0 m</span>²
,167 Mio. €
->16<span class="text-nowrap">7 M</span>io. €
)
As you can see, if you provide an replace pattern, than an regular expression will handle the replacement, otherwise if only an search pattern is provided, spaces will be protected with
.