aEr_aEr
11-21-2002, 08:44 AM
hi,
i want to maken a filter that replaces 2 or more font tags with one, I want the attributes of the innerFonttag to replace the attributes of the outerFonttag
example:
<font color=#ff6677 size=2><font size=3 face=arial>fadsf</font></font>
this i want to replace with
<font color=#ff6677 size=3 face=arial>fadsf</font>
but between the <font> and the </font> almost every character is possible how do i filter that. And how can i build replace string.
I've tried a couple of things and came up with something like this
tekst = tekst.replace(/<font\s[\w:\"\';\#]*><font\s[\w:\"\';\#]*>[\w]*</font></font>/ig,"");
but this doesn't work because it clears the font tags and not every character between the font-tags is seen only alphanumeric character and underscore.
does anyone have a id how to do this correct
i want to maken a filter that replaces 2 or more font tags with one, I want the attributes of the innerFonttag to replace the attributes of the outerFonttag
example:
<font color=#ff6677 size=2><font size=3 face=arial>fadsf</font></font>
this i want to replace with
<font color=#ff6677 size=3 face=arial>fadsf</font>
but between the <font> and the </font> almost every character is possible how do i filter that. And how can i build replace string.
I've tried a couple of things and came up with something like this
tekst = tekst.replace(/<font\s[\w:\"\';\#]*><font\s[\w:\"\';\#]*>[\w]*</font></font>/ig,"");
but this doesn't work because it clears the font tags and not every character between the font-tags is seen only alphanumeric character and underscore.
does anyone have a id how to do this correct