You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.
Would this plugin be able provide a $field->hyphenate($lang) method, without major refactoring?
As argued in #6, hyphenation is a design choice. And I'll add that a designer or client may want hyphenation for some texts (e.g. an article's body) but not for others (e.g. a big title).
This is really one of the features, which is harder to implement, because PHP-Typography is meant to be given a string, where features are applied to. The only possibility to do this, would be to create a new instance of PHP-Typography and then apply everything to it. It is also possible to clone the current instance of the class and change all settings. With the current codebase, this is very hard to realize.
But it should be possible to use both Smartypants an Kirby-Typography in the same template without too many changes. It also seems to be possible to override built-in field methods. With that in mind, it would be possible to override the default settings for every call to field->kirbytext() with an additional parameter or provide methods like unhyphenate(), where a simple str_replace() coudl remove all ­ characters from the text. Custom options for Kirbytext could be a really interesting way how to do it. I could also think of providing a field->typography() method for custom configuration instead. I will think about that, but to 1.0.0, I would prefer to get rid of current bugs and leave all new features and APIs out of the initial release. Added it to the 1.1 milestone.
Would this plugin be able provide a
$field->hyphenate($lang)
method, without major refactoring?As argued in #6, hyphenation is a design choice. And I'll add that a designer or client may want hyphenation for some texts (e.g. an article's body) but not for others (e.g. a big title).
What might serve this use case:
The text was updated successfully, but these errors were encountered: