Re: Hyperlink styling

Neil <[email protected]>
Newsgroups gmane.comp.mozilla.devel.editor
Message-ID <[email protected]>
Greg Amerson wrote:

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

Apparently the editor disables something called the preference 
stylesheet which among other things sets the default text, background 
and link colours. The styles were added to restore the appearance of 
links, although I guess they didn't try it out on styled links.

The reason that "Remove Link" changes your <a> to a <span> is that the 
editor has no reason to remove your inline style, so it doesn't. For a 
similar example, consider changing a list from an <ol> to a <ul>, why 
should the editor delete the inline style?

-- 
Warning: May contain traces of nuts.
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.