Categories > TinyButStrong general >

max and htmlconv error

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Mario Miele
Date: 2003-10-04
Time: 11:59

max and htmlconv error

Hi,
It appears as
[blk1.recname;max=40;htmlconv=look]
and
[blk1.recname; htmlconv=look;max=40]
behave different (the first one doesn't make html conversion)

An error?
By: Skrol29
Date: 2003-10-06
Time: 09:53

Re: max and htmlconv error

Hi Mario,

I don't have this behavior.

Did you check that the space before the htmlconv=look has not a break line in you template ?
By: Mario Miele
Date: 2003-10-06
Time: 12:44

Re: max and htmlconv error

Maybe I found the thing:

it appear as max worked before htmlconv so an html entity (as 'à') at the end of the string is truncated and then not parsed by htmlconv.
By: Skrol29
Date: 2003-10-06
Time: 13:06

Re: max and htmlconv error

I'm suprised because the max truncate is proceed before the Html conversion.

And I can also say that the order of parameters doesn't matter for TBS.
By: Mario Miele
Date: 2003-10-06
Time: 13:10

Re: max and htmlconv error

I think just because max truncate works before the conversion the html entity may been truncated
By: Skrol29
Date: 2003-10-06
Time: 13:13

Re: max and htmlconv error

Ho, yes you're right. That's possible if the data contains a Html special cher before the merge.

But the order of the parameters must change nothing.
By: Mario Miele
Date: 2003-10-06
Time: 13:16

Re: max and htmlconv error

It's ok for the order of parameter, but, how can I solve the problem?
maybe an onformat call to an external function to make the conversion?
By: Skrol29
Date: 2003-10-06
Time: 13:19

Re: max and htmlconv error

It depens on what can contain the data "recname".
Is it always an Html string, or only sometimes ?
By: Mario Miele
Date: 2003-10-06
Time: 13:25

Re: max and htmlconv error

This times it's always an html string.
By: Skrol29
Date: 2003-10-06
Time: 13:35

Re: max and htmlconv error

If you have PHP>=4.3 then I suggest that you use a 'onformat' function to perfom the length limitation.

You can use html_entity_decode() to convert Html to Normal text, then make the limitation, and then convert the string back to html.
By: Mario Miele
Date: 2003-10-06
Time: 13:39

Re: max and htmlconv error

thanks, I will do that.