[Laszlo-dev] The `string`, `text`, and `html` types [Was For Review: Change 20100525-ptw-1 Summary: Correct quoting of string-typed attributes]

André Bargull andre.bargull at udo.edu
Thu Jun 10 14:05:25 PDT 2010


On 6/10/2010 10:41 PM, P T Withington wrote:
> On 2010-06-10, at 16:35, P T Withington wrote:
>
>> On 2010-05-26, at 17:42, P T Withington wrote:
>>
>> [...]
>>
>>> I propose then that we distinguish the types `text` and `html` from `string`, and that we permit them on any attribute (not just on an attribute named "text":  although it is by defining an attribute named text that you tell the schema that your class defines a tag that permits content, you might want other attributes with these types).  I propose the following semantics:
>>>
>>> string:  Value is parsed as an ECMAScript string
>>> text:  Value is parsed as XML CDATA
>>> html:  Value is parsed as XML content
>>
>> There's one issue with my proposal:
>>
>> Currently, LZX treats string, text, and html as synonyms.  They are close, but if we distinguish them as above, they are clearly not, if you have any ES or XML characters that would be escaped.
>>
>> I tried making the declared type of<text>'s text field be honest (it is really `html`, because it is not quoted in any way), and run into lots of compiler type warnings because in lots of places, components and demos have created subclasses of text, or simply initialized the text attribute and have (pointlessly) re-declared the type of the text field.
>>
>> I don't have a solution other than removing the declarations from the components and demos as we come across them.
>>
>> Other opinions?
>
> Or, maybe I am wrong.  Maybe the intent is that<text>  is of type `text`, that it does _not_ interpret HTML?  But I think it does, since we seem to allow simple markup in text, right?

<text> needs to be styleable with html markup.

I think we should try to split your change in two parts:
(1) make string, text and html distinct types
(2) change how these types are quoted

Both changes may break components and demos (at least (1) does, as 
you've observed), so we shouldn't step in with the chain saw and then 
desperately try to make things working again. So I vote for incremental 
steps.


More information about the Laszlo-dev mailing list