Hyperlink styling

Greg Amerson <[email protected]>
Newsgroups gmane.comp.mozilla.devel.editor
Message-ID <[email protected]>
I recently noticed that if you style your links in a page and load it 
into the editor it will still use the default blue text with an 
underline decoration.

So the following example link will still be blue and underlined if you 
load it in the editor.

<html>
<body>
Go to <a href="http://mozilla.org"
   style="text-decoration: none; color:red">Mozilla.org</a>
</body>
</html>

I was looking into the inline style isn't being used and I found the 
relevant entry in the EditorOverride.css from the mozilla editor source.

/* snippet taken from 
mozilla/composer/base/content/composer/EditorOverride.css */

/* We suppress user/author's prefs for link underline,
    so we must set explicitly. This isn't good!
*/
a:link {
   text-decoration: underline -moz-anchor-decoration;
   color: -moz-hyperlinktext;
}


I experimented just by taken this out to see what happens and it does 
allow the link to be styled but some other funny things happen 
specifically with the "Remove Link" editor command.  It seems to remove 
the <a> but adds a <span> back in its place and then adds the styling to 
the span to match the original link styling.

Does anyone know the history behind this entry in EditorOverride.css?  I 
am writing an application that embeds xulrunner and uses the mozilla 
editor and what other potential problems might I run into if I remove 
this entry to suppress the user styled links?

Thanks for any information or ideas

Greg
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.