Jump to content
ryan

PW 3.0.101 – Core updates

Recommended Posts

This week's version of ProcessWire on the dev branch continues resolution of GitHub issue reports, and it also adds a new text truncation function to our $sanitizer API, something requested from our requests repository:

https://processwire.com/blog/posts/processwire-3.0.101-core-updates/ 

We didn't have a blog post for last week's version 3.0.100—see the core updates section in ProcessWire Weekly #207 for more details on that version.

  • Like 17

Share this post


Link to post
Share on other sites

Thanks Ryan - this truncate method looks awesome - way to over-deliver :)

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

There is a typo in your post @ryan.

You write:

Quote

.. and it also adds a new text truncation function to our $sanitizer API ...

The correct sentence should be:

Quote

... and it also adds a new swiss-army-knife-like truncation function to our $sanitizer API

But okay... I'm fine with your sentence, too.

  • Like 4

Share this post


Link to post
Share on other sites

Wow, that truncate function will truncate my search for the ultimate truncate function! 😁

I wonder if the default for the "visible" option should be true rather than false. If my string included entities and markup tags I think in nearly all cases I wouldn't want those invisible items affecting the visible string length.

  • Like 4

Share this post


Link to post
Share on other sites
Quote

I wonder if the default for the "visible" option should be true rather than false. If my string included entities and markup tags I think in nearly all cases I wouldn't want those invisible items affecting the visible string length.

That's a good point, and maybe we'll change that before this gets off the dev branch. I left it false by default because it means a little more work for the function to perform. With defaults, I try and find a balance between the most likely to be used settings, with those that perform with the lowest overhead. There's also the matter of the "visible" option being more useful when the "keepTags" or "keepFormatTags" options are in use, where it can make a big difference. Though even without those options in use, there could still be entities counted as more than 1 character, so perhaps visible as true by default might be better. 

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...