HTML Tag Cleaner Fails
Bill Marriott
wjm at wjm.org
Tue Aug 8 16:58:51 EDT 2006
Dar Scott wrote:
> You are assuming that a field and htmlText has something to do with HTML.
>
> 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." And the detailed list of supported, unsupported, and
custom HTML tags which follows?
Seriously, this is a stretch.
Consider the Rev text field the equivalent of a WAP 1.0 browser, or
something like that. It is a bonafide HTML presentation, to the extent of
what Rev text fields are capable of rendering. A relatively complete set of
text formatting is available. Images are incorporated as appropriate. Links
are handled. And so on. I assume the only reason the rendering is not more
complete are the limitations of the field control and Rev itself.
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 and b)
to render incoming HTML as properly as possible. The <title> element is
specifically defined in the HTML specification: "The TITLE element is not
considered part of the flow of text."
> Stripping <title> is bizarre.
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.
More information about the use-livecode
mailing list