kesabr/kirby-soft-hyphen
最新稳定版本:v1.0.2
Composer 安装命令:
composer require kesabr/kirby-soft-hyphen
包简介
Helper to use a designated character in the panel to create a soft hyphen in the frontend
README 文档
README
Take control of hyphenation — place soft hyphens exactly where you want them, right from the panel. Soft hyphens are invisible in the browser but tell the browser to break and hyphenate at that position when the line is too long. No more relying on automatic hyphenation algorithms that break words in the wrong place.
The plugin adds a soft hyphen button to the Writer toolbar.
Installation
Drop the kirby-soft-hyphen folder into site/plugins/ of your Kirby project.
Features
- A soft hyphen button for the Writer field.
- Soft hyphens are highlighted inside the Writer.
->softHyphen()field method to clean soft hyphen markup before frontend output.||shorthand for inserting soft hyphens in text and textarea fields.
Usage
Writer field
Add softHyphen to the marks list of any writer field in your blueprint:
fields: text: type: writer marks: - bold - # your marks - softHyphen
Field method ->softHyphen()
Call ->softHyphen() on any field before outputting it in a template:
<?= $page->text()->softHyphen() ?>
Writer fields — The writer stores soft hyphens wrapped in <span class="k-shy"> for editor visibility. ->softHyphen() strips those spans so only the bare entity remains in the frontend HTML. The soft hyphens technically work even without this call (the entity is already inside the span), but calling it keeps your markup clean.
Text / textarea fields — Type || where you want a soft hyphen. ->softHyphen() is required to convert || → in the output.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-09