Invenzzia »

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
| Tasklist

FS#164 - A version of truncate() that handles HTML code correctly

Attached to Project: Open Power Template
Opened by Zyx (Zyx) - Friday, 11 June 2010, 02:24 GMT-7
Last edited by Zyx (Zyx) - Friday, 11 June 2010, 02:26 GMT-7
Task Type Feature Request
Category Function set
Status New
Assigned To Zyx (Zyx)
Operating System OS-independent
Severity Low
Priority Normal
Reported Version 2.0 SVN
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

The current implementation of truncate() function is not suitable to deal with HTML content and can make some damage for the tags. It has been suggested to provide a next version of this function which does not have this problem.

Supposed behaviour:

String: 'Foo <i>Bar</i>'
Truncate on: 5
Effect: 'Foo <i>B</i>...'

String: 'Foo <img src="bar.jpg" />'
Truncate on: 5
Effect: 'Foo '

String: 'Foo <img src="bar.jpg" /> Joe'
Truncate on: 7
Effect: 'Foo <img src="bar.jpg" /> J'

Basically, the truncation position means just the printable characters and HTML tags remain untouched. In case of opening tags, they must be closed properly.
This task depends upon

Loading...