[TYPO3-core] RFC: #7860: Coloring in TS Object Browser depends on "Crop Lines"

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sun May 18 15:38:07 CEST 2008


Steffen Kamper schrieb:
> "Martin Kutschker" <martin.kutschker-n0spam at no5pam-blackbox.net> schrieb im 
> Newsbeitrag 
> news:mailman.1.1205879814.17672.typo3-team-core at lists.netfielders.de...
>> No it doesn't.
>>
>> The cropping is done when the values have still the constant markers (eg
>> ##6fb6de_B##) applied to it. So a large constant may loose it's closing
>> marker, which will lead to a missing, yikes, closing font tag.
>>
>> A solution is to check if a value has crop markers like that in
>> t3lib/class.t3lib_tsparser_ext.php:
>>
>> if (strncmp($theValue,'##'.$this->Cmarker.'_B##',12)) {
>>  $theValue = $this->ext_fixed_lgd($theValue,$lgdChars);
>> } else {
>>   // crop "real" value and re-apply constant markers
>>  $theValue =
>> '##'.$this->Cmarker.'_B##'.$this->ext_fixed_lgd(substr($theValue,12,-12),$lgdChars).'##'.$this->Cmarker.'_E##';
>> }
>>
>> This worked for me but is a bit whacky. OTOH the crop feature isn't very
>> clean implemented itself.
>>
>> Masi
>>
>> PS: t3lib/class.t3lib_tsparser_ext.php::ext_fixed_lgd() is buggy as it
>> doesn't use use t3lib_cs->crop or t3lib_div::fixed_lgd_cs() for
>> cropping. UTF-8 characters may be destroyed!
> 
> right,  i didn't looked to htmlsource.
> 
> So i followed your proposal. I changed it only in function ext_fixed_lgd, 
> see attached patch.
> 
> i hope to be right that also with utf8 the marker-length is 12,

Yes, the marker is all 7-bit ASCII which is also a single byte in UTF-8 
(identical to ASCII).

+1 on reading.

Masi


More information about the TYPO3-team-core mailing list