can't trust htmltext property!

Eric Chatonet eric.chatonet at sosmartsoftware.com
Tue Nov 29 13:02:06 EST 2005


Hi Andre,

Unfortunately, Rev HTML is not HTML :-(

 From the docs:
The HTMLText property uses a tag structure that is HTML-like, but is  
not completely standard HTML, in order to accommodate the full range  
of text styling available in Revolution.

And:
When you set the HTMLText of a field, all tags other than those above  
are ignored, except heading tags (<h1>--<h6>), which change the size  
of the text in the heading element:
	tag		textSize
	<h1>		34 point
	<h2>		24 point
	<h3>		18 point
	<h4>		14 point
	<h5>		12 point
	<h6>		10 point

All this does not help :-(

Best Regards from Paris,

Eric Chatonet.

Le 29 nov. 05 à 18:49, Andre Garzia a écrit :

> why on earth Rev is doing this presentation hack. Put a field on a  
> stack, set the htmltext of the field to "<h2>SOMETHING</h2>", now,  
> pull the html text property and you'll end with something like:
>
> <p></p>
> <p></p>
> <p><font size="24"><b>SOMETHING</b></font></p>
> <p></p>
> <p></p>
>
> Now, if, I set a prop to header 2, I want to pull a header 2, not  
> something else... I understand that visually it looks the same but  
> for anyone working with HTMLText inside a field this is a big no  
> no, show stopper. It's picking one carefully selected tag and  
> replacing it with dozens of tags, nesting them and doing all kinds  
> of stuff.
>
> Heck, is this documented somewhere? Something like "hey user beware  
> the htmltext, it's a lotery, if you set it, you'll never know what  
> you'll pull out."
>
> I am doing a html editor, I thought that if I set a field htmltext  
> to some html chunk, allowed user to fiddle a little with it, like  
> seeting things bold and changing the string, and after fetching the  
> htmltext prop would reflect that changes but the root tag would not  
> be affected. Now if you're doing a simple editor, just to edit some  
> tags and you end up with the nightmare above, you can kiss your CSS  
> setup goodbye... Is there a solution or should I simply start  
> rolling my own rich editor not trusting the HTMLText property...
>
> HELL the thing is even loosing attributes!!!! if you use something  
> like "<p class="footer">my text</p>" when you check the htmltext  
> prop you end up with no attributes. I think it's okay for rev to  
> ignore the attribute but to loose it.... things should be simpler.

----------------------------------------------------------------
So Smart Software

For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch

Free plugins and tutorials on my website
----------------------------------------------------------------
Web site        http://www.sosmartsoftware.com/
Email        eric.chatonet at sosmartsoftware.com/
Phone        33 (0)1 43 31 77 62
Mobile        33 (0)6 20 74 50 86
----------------------------------------------------------------




More information about the use-livecode mailing list