Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2018 at 01:55 UTC
Updated:
20 Nov 2018 at 23:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
johnchqueThis should make the magic, adding tests. :)
Comment #3
miro_dietikerIf this creates an encoded entity like & after 148 characters then it would be cutoff and display wrongly.
I think we should apply htmlspecialchars after truncation.
But yeah you're right, the raw summary isn't truncated at all currently...
I think we should truncate right after this line for the first time.
Comment #5
johnchqueShould be better now. :)
Comment #6
johnchqueI forgot the interdiff.
Comment #8
miro_dietikerWe should truncate this too, otherwise it could be a huge BLOB of HTML Script or so.
Comment #9
johnchqueTest not changing, thus previous test only patch still applies. :)
Comment #10
berdirThere is no need to do a separate strlen() check ourself for > 150, Unicode:: truncate() does that too as basically the very first thing.
So I think you can just integrate that into the existing lines: Unicode::truncate(trim(strip_tags($text))) and then the same for the html version.
Comment #11
johnchqueMore magic. :) Thanks @Berdir!
Comment #12
berdirThanks.
Comment #14
miro_dietikerAwesome. Committed. :-)