kesabr/kirby-soft-hyphen

Helper to use a designated character in the panel to create a soft hyphen in the frontend

Maintainers

Package info

github.com/kesabr/kirby-soft-hyphen

Language:JavaScript

Type:kirby-plugin

pkg:composer/kesabr/kirby-soft-hyphen

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.2 2026-06-09 08:26 UTC

This package is auto-updated.

Last update: 2026-07-09 08:50:59 UTC


README

Kirby 4 Kirby 5 Packagist

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

Via Composer:

composer require kesabr/kirby-soft-hyphen

Manual: 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.