定制 kesabr/kirby-soft-hyphen 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

Kirby 4 Kirby 5

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固