Styled text challenge...

xbury.cs at clearstream.com xbury.cs at clearstream.com
Wed Feb 11 10:39:48 EST 2004


Hi everyone,

Other than parsing completely out the html code, you would assume that

set the RTFText of fld "text" to the HTMLText of fld "html"

converts html to styled text... BUT IT DOESNT! 

There doesn't seem to be any other language features for this purpose.

This conversion is catastrophic! It should work (since it's allowed) but 
it strips all the returns (it expects the CRLF is my guess) and puts in 
the bland HTML code into one big line of black text... After x characters, 
the field wont wrap the lines, and you are surely asking for trouble! 

Funnier, there is not one linefeed in the fld after the conversion. 

set the RTFText of fld "text" to fld "html" - gives you non-formated text 
without any paragraphs (or returns or linefeeds). What happened to the 
standards as seen in the link mentioned in the documentation?

But it sounds insane that you have to go through hoops to do this simple 
task. Why is styled text still a thing of the future - you'd think that 
since HC 2.2 this would work...

put fld "html" into fld "text" - is the only thing that works... without 
styles, colors or sizes...

Bug or another incomplete feature? ;) 
I imagine the RTF text is there for file compatibility only... 
alas it was my only solution to avoid coding a hord of html to styled text 
for my stealth browser...

Anyone found a magical hidden setting that I missed? I would like to 
simply convert styled HTML text to Styled text...

repeat with x = 1 to length(fld "HTML")
  repeat for every item i in "style,size,lineheight,color, etc"
    do "set the " & i &" of char c of fld "& quote & "text" & quote & " to 
the"& i&" of char c of fld "text" -- I wont bother with the right syntax 
if you dont mind... 
 end repeat
end repeat
-- 2 million ticks later...
Answer "Your Styled text is ready for viewing...  Thanks for your 
patience."

Cheers
Xavier


Visit us at http://www.clearstream.com
                                                          
IMPORTANT MESSAGE

Internet communications are not secure and therefore Clearstream International does not accept legal responsibility for the contents of this message.

The information contained in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Any views expressed in this e-mail are those of the individual sender, except where the sender specifically states them to be the views of Clearstream International or of any of its affiliates or subsidiaries.

END OF DISCLAIMER


More information about the use-livecode mailing list