views:

118

answers:

2

the html like this:

"[font color="#FF0000"]test [font color="#FF0000"]Hello world[/font][/font]"

I want to replace the font tag the result like this:

test Hello world

thanks you

A: 

doc.search("font").remove?

corroded
I just want to remove the <font> tag but not the content like: <font>test</font> I want to get: test
www
this will be work: content.gsub(/<font .*?>|<\/font>/, '')
www
A: 

If you want to remove html and only want text USE

string = "<font color='#FF0000'>test <font color='#FF0000'>Hello world</font></font>"
strip_tags(string)
Salil
where is the strip_tags method I just want to remove the <font> tag but not the content like: <font>test</font> I want to get: test not other tag
www
No This will remove html tags http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#M002165
Salil
this will be work: content.gsub(/<font .*?>|<\/font>/, '')
www