heimrichhannot / contao-hyphenator-bundle
contao内容管理系统中的单词连字符。
1.11.4
2023-09-06 14:00 UTC
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-09-02 09:31:46 UTC
README
这是一个contao插件,它提供了服务器端的连字符功能(感谢 vanderlee/phpSyllable)。它默认支持标题和段落。
此模块还处理行中断异常,以保持公司名称等单词在一起,并防止行中断(请参阅 tl_page
后端实体)。
选项
为了扩展功能,可以在您的本地配置中调整所有选项。
跳过连字符
如果您想跳过几个标签的连字符,只需将 hyphen-none
作为css类添加到相应的元素或使用 tl_page.hyphenation
字段。
您还可以将需要跳过的标签添加到项目配置中。请参阅以下配置参考
配置参考
# 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: []
行中断异常
Hyphenator附带行中断异常处理。只需在 tl_page
上添加 lineBreakExceptions
以防止连接的单词组如
- 公司名称(搜索:
Heimrich & Hannot(?:\sGmbH)|Heimrich & Hannot(?:s)?
,将替换为:<span class="text-nowrap">Heimrich & Hannot GmbH</span>
) - 价格和其他单位(搜索:
(\d|€)(\s)(\w)
,替换:$1[nbsp]$3
,示例:160.000 m²
->160.00<span class="text-nowrap">0 m</span>²
,167 Mio. €
->16<span class="text-nowrap">7 M</span>io. €
)
如您所见,如果您提供了替换模式,则正则表达式将处理替换,否则如果只提供了搜索模式,则使用
保护空格。