[Laszlo-dev] <text> vs. html

P T Withington ptw at pobox.com
Tue Nov 11 12:59:34 PST 2008


I'm thinking it would be a nice improvement to have the `text`  
attribute be literal (auto-escaped) and if you want to write html into  
a <text> you set the `html` attribute.  Clearly the _content_ of a  
<text> tag is html, but it would seem more useful if the `text`  
attribute were not.  That would seem to be more natural for people  
coming from HTML too.

On 2008-11-11, at 15:08EST, Henry Minsky wrote:

> I think the text content is always treated as HTML when the text field
> displays it.
>
> We had *inputtext* have a special case where it escaped it for you,
> because swf5 couldn't handle
> HTML directives in it's text field.  Maybe that's what you're  
> remembering...
>
> And yes, it sucks to have to escape this. I think you would need to
> escape it twice actually if you
> wrote it out in lzx, once for the lzx parser, and once for the  
> TextField object.
>
> <text text="&amp;lt;text&amp;gt;">
>
> On Tue, Nov 11, 2008 at 12:36 PM, P T Withington <ptw at pobox.com>  
> wrote:
>> I am confused.
>>
>> If I say:
>>
>> <text text="<testing>" />
>>
>> I see nothing.
>>
>> I _thought_ I remembered that if you wanted to write html into a  
>> text node,
>> you would set the `html` attribute and that setting the `text`  
>> attribute
>> would, by default, not interpret `<` as html.  Did I imagine this?   
>> Or just
>> confuse our text nodes with those of HTML?
>>
>> It seems really sad to me that I have to say:
>>
>> <text text="${this.escapeText('<testing>')}" />
>>
>> to make it work.  Also, `escapeText` is a terrible name (since it  
>> is really
>> escaping XML, not text).
>>
>> Can we fix this, or are there actually legacy programs that depend on
>> writing html markup into <text>?  I would think if you wanted to  
>> write html
>> markup, you ought to be using the <html> tag?
>>
>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list