sekru Posted August 26, 2019 Posted August 26, 2019 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
dragan Posted August 26, 2019 Posted August 26, 2019 How are you using it? Maybe try with output formatting set to false?
sekru Posted August 26, 2019 Author Posted August 26, 2019 $value->of(false); echo '<p>'.$sanitizer->truncate( $value->body , 300, array('type'=>'sentence', 'keepFormatTags'=>true)).'</p>';
Torsten Baldes Posted August 29, 2019 Posted August 29, 2019 @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!
sekru Posted August 30, 2019 Author Posted August 30, 2019 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.
elabx Posted August 30, 2019 Posted August 30, 2019 13 hours ago, sekru said: I hope that @ryan can fix it. I think the best chance is to post it in the issues github repo.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now