[TYPO3-core] RFC #7984: Bug: stdWrap.crop now closes opened tags and counts chars correctly

Jochen Rau jochen.rau at typoplanet.de
Thu Aug 27 11:23:25 CEST 2009


Hi Susanne, Hi Masi.

Susanne Moog wrote:
> Rupert Germann schrieb:
>> Susanne Moog wrote:
>>> +1 by testing
>> by testing? please describe what you did.
>>
>> for me it doesn't work as intended. That's what I did:
>>
>> I took an empty page end created a root TS on it with the following setup:
>>
>> page = PAGE
>> page.10 = TEXT
>> page.10.cropHTML = 30|...
>> page.10.value (
>>
>>     # HTML code of any page
>>
>> )
>
> This was my test setup:
>
> page = PAGE
> page.10 = TEXT
> page.10.value (
> 	<span>something ... here and there and text and bla</span>more text
> more text more tags<br />  more text
> )
> page.10.cropHTML = 30
>
> That results in<span>something ... here and the</span>
>
> I varied the char count and added the second and third parameter (like
> 30|...|1 --->  <span>something ... here and...</span>)
>
> By counting the exact amount of chars I noticed just now that it seems
> to count the chars inside the brackets, too (like above the chars of
> "span"), which results in a lower number of chars being actually
> displayed. With the thirty char configuration I just did not notice, but
> with one of 5 you see that right away (sorry for having missed that
> testing the first time).
>
> So it works but perhaps different than intended.

The patch doesn't count the chars in the brackets. I think you expected 
the wrong output. That may also be the reason for the behavior Masi 
encountered.

You have tabs in your code. cropHTML counts tabs but the browser does 
not show them. Should cropHTML be aware of "invisible" chars?

IMO cropHTML works as expected.

Regards
Jochen

-- 
Every nit picked is a bug fixed



More information about the TYPO3-team-core mailing list