TopShelfCraft / Wordsmith

A plugin for Craft CMS to help you manage and manipulate text.
Other
30 stars 20 forks source link

Widont Not Working #32

Closed kerns closed 4 years ago

kerns commented 4 years ago

Or at least this is how it feels. What might I be doing wrong? Neither of these is working.

{% filter widont %}{{ entryTitle }}{% endfilter %}
{{ entryTitle|widont }}
michaelrog commented 4 years ago

To troubleshoot, it'd be helpful to know the actual text of entryTitle in your example. — Could you try running a raw string (rather than a variable) through the filter, and let us know the output?

(Also, check to see if your case is similar to #5, where widont ignores sufficiently long words...?)

kerns commented 4 years ago

Sure. the headline in this case was Rare and Fully Documented Giulietta Sprint

{% filter widont %}Voluptatem numquam nesciunt voluptates ipsasdsdsdsd explicabo!{% endfilter %}is not responding either. 🤔

kerns commented 4 years ago

Any other ideas or things I might test to help debug this?

michaelrog commented 4 years ago

As I suspected, this is a repeat of #5.

By default, widont only takes effect if the widowed line would be shorter than 5 characters.

You can tweak this by adding more aggressive settings in your wordsmith.php config file:

return [
    'typographySettings' => [
        'set_max_dewidow_length' => 25,
        'set_max_dewidow_pull' => 25,
    ]
];
michaelrog commented 4 years ago

Since this is a common issue, I'm going to raise the threshold to 10 characters. Update to Wordsmith 3.3 to get that adjustment.