How to keep span tags open

Thomas Comiotto <[email protected]>
Newsgroups gmane.comp.mozilla.devel.editor
Message-ID <[email protected]>
Hi all,

Is there a way to force a nsIHTMLEditor to keep a span tag open when  
this tag only contains a blank text node?

^: cursor

<span>X^</span>

After deleting the last character surrounded by the tag the cursor  
disapears and there seems to be no way of re-inserting text into the  
corresponding tag. I guess this is the case with all inline tags?

With block elements, a placeholder tags (<br type="_moz"  
_moz_dirty=""/>) is inserted automatically that keeps the  
corresponding element open.

I am currently adding the needed placeholder tags for inline elements  
by hand but this looks like an ugly hack to me. Also, span tags  
surrounded by a block element seem to require a block placeholder to  
work correctly..


Is the auto-keep-open/close behaviour documented somewhere, including  
where and when _moz_dirty tags are inserted during a transaction, or  
can anyone give a short summary of how this stuff works?

I'am running Firfox 1.5 on OSX.


Thanks!
Thomas








------------------------------------------------------------------------ 
-----
                         Thomas Comiotto              
[email protected]

                         Universitaet Zuerich
                         Informatikdienste                Tel: +41 44  
63 54541
                         Winterthurerstrasse 190               +41 44  
63 43333
                         CH-8057 Zuerich                  Fax: +41 44  
63 54505
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.