[Greasemonkey] Stripping font tags

Aaron Boodman zboogs at gmail.com
Sun Dec 4 14:33:32 EST 2005


Not sure if this went through while the server was down the other day.
I think it better adresses TOP's exact question since I'm not adding
spans :-).

- a

On 12/1/05, Aaron Boodman <zboogs at gmail.com> wrote:
> Sure. Untested:
>
> var fontTag;
> var parent;
> var marker;
>
> // for each font tag
> while (fontTag = document.getElementsByTagName("font")[0]) {
>   parent = fontTag.parentNode;
>   marker = fontTag.nextSibling;
>
>   // move the font tag's child nodes up into the parent in the right place
>   while (fontTag.firstChild) {
>     parent.insertBefore(fontTag.firstChild, marker);
>   }
>
>   // remove the font tag, now that it's empty
>   parent.removeChild(fontTag);
> }
>
> - a
>
> On 11/30/05, Randy Burke <uncle.ranny at gmail.com> wrote:
> > I have an internal work page that i want to skin, the big problem that I am
> > having is that it was  wrote with a bad mix of CSS and font tags.
> >
> > I was just wondering if there is a easy way to strip all the font tags out
> > of the page
> >
> > Randy B.
> > _______________________________________________
> > Greasemonkey mailing list
> > Greasemonkey at mozdev.org
> > http://mozdev.org/mailman/listinfo/greasemonkey
> >
>


More information about the Greasemonkey mailing list