[TYPO3-mvc] RFC: #7743: fluid should crop HTML right

Jochen Rau jocrau at jochens-macbook.fritz.box
Tue Jun 1 11:14:52 CEST 2010


On 2010-05-29, Xavier Perseguers <typo3 at perseguers.ch> wrote:
> Hey,
>
>> Am 28.05.10 23:42, schrieb Xavier Perseguers:
>>> There's enough magic and there'll always be some edge-cases where it
>>> does not what is wanted.
>>
>> You think of this kind of cases, in which you want your text to be
>> cropped in the middle of an html tag? something like
>>
>> <img src="http://images.google.com/?q=fooBa...
>>
>> ;-)
>>
>> Normally I'm totally with you, too much magic is contraproductive ...
>> but in cropping text I think it's obvious what happens.
>
> Without thinking too much, what about a view that shows a listing of HTML snippets and use part of it as "teaser"? The view itself takes the teaser (cropped with the crop view) and renders it with 
> htmlentities()?

That's really a rare edge case. I'd just change crop() to cropHTML() as
cropHTML() does the job right in 99% of the use cases. If somebody writes an
extension to have HTML teasers cropped without applying htmlentities before,
he should be able to write his own crop-ViewHelper implementation.

I strongly recommend to implement only the minimal set of features making it a
good product.

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list