Jump to content

Recommended Posts

Posted

Hello,

is this a bug?
If i use $santizer->truncate to shorten a CKEditor-Text, the URL is left in the text (as you can see at the image).

Hope, someone can help me.
Sebastian

Anmerkung 2019-08-26 183148.jpg

Posted
$value->of(false);
echo '<p>'.$sanitizer->truncate( $value->body , 300, array('type'=>'sentence', 'keepFormatTags'=>true)).'</p>';
Posted

@sekru

Did you found a solution for this?

I've got a similar/the same problem, which i just discovered on a live site ?. For me headlines get underlined with "=" or "-", when i truncate text.

It seems like that in newer versions from ProcessWire (since 22 May) the markupToText function (https://github.com/processwire/processwire/blob/dev/wire/core/WireTextTools.php#L57), which is used by truncate when stripTags=true, got some new options like linksToUrls (your problem) and underlineHeadlines (my problem).

Unfortunately it seems not possible to set these options via the truncate function. I think truncate should set these options to false.

@ryan Ist this by intent? Is there a way to prevent this?

Thanks!

Posted

I don't have a solution yet.
Looks like it has something to do with Markdown. For whatever reason.

I hope that @ryan can fix it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...