Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted September 23, 201212 yr When I do a IPSText::truncate( $s['s_message'], 100 ); If there is html in the startup it is counted towards the length of the string. This means that the shortened text (visually) can be dramatically less than the required number of characters. What I think needs to happen is that the tags need to be stripped and the offset calculated without the html and then that offset translated into the formatted string. I know easy for me to say :tongue:
September 24, 201212 yr Just implemented this , I would agree :) - had to extend the truncate by a few more to take into account the html
September 24, 201212 yr When I do a IPSText::truncate( $s['s_message'], 100 ); If there is html in the startup it is counted towards the length of the string. This means that the shortened text (visually) can be dramatically less than the required number of characters. What I think needs to happen is that the tags need to be stripped and the offset calculated without the html and then that offset translated into the formatted string. I know easy for me to say :tongue: You should never truncate raw HTML text. Really funny things happen when you end up with something like hello this is some text and here is a <a href='http://www.google.com'>
Archived
This topic is now archived and is closed to further replies.