HTML Tag Cleaner Fails

Dar Scott dsc at swcp.com
Tue Aug 8 18:49:35 EDT 2006


On Aug 8, 2006, at 2:58 PM, Bill Marriott wrote:

>>
>> What do you base this assumption on?
>
> Oh, I dunno, the name of the function beginning with "HTML?" The
> documentation which states, "Specifies the contents of a field,  
> with its
> text formatting represented as HTML tags and special characters  
> represented
> as HTML entities."

Look at what that actually says.

It says "with its text formatting represented as HTML tags".

It never ever says the field displays HTML.

It is clear that htmlText was never intended to have to do with  
HTML.  What is the lowest most functionality of HTML?  The handling  
of white space.  The htmlText property does not do that in output or  
input.  Metacard and RunRev were clear some time ago in that this is  
not a bug.

BUT, I think it would be a good idea to expand htmlText (when  
fetched) to be a string that would display the same content (or very  
similar) content when dumped into an HTML display.  I suspect that  
anything that can be displayed in a field can be represented in  
HTML.  This enhancement will probably break scripts, though.  (Links  
have completely separate semantics, though, and will not transfer  
completely.)

> Links are handled.

They are?

> There can be no doubt that the intention of the function is to a)  
> export the
> styled content of a text field as faithfully as possible using HTML

A candidate for an enhancement request.  I'd vote for this.  I'm not  
sure how it should handle dontWrap.

> and b)
> to render incoming HTML as properly as possible.

Nonsense.  It can't render HTML.

> No, it's exactly the right thing to do if you're implementing a  
> function
> named HTMLText() that is designed to process HTML tags at best-effort.

It is clear from its behavior that that was not what it was designed  
for.  No effort was made to make that happen.  Would you have  
released htmlText the way it is if you made it to render HTML?

So removing <title> is bizarre.  Somebody complained or asked for it  
and it was tacked on.

Dar Scott





More information about the use-livecode mailing list