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 worl开发者_如何转开发d
thanks you
Just do
doc.inner_text
with hpricot
Sure it will remove all tags. Not only <font>.
doc.search("font").remove?
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)
精彩评论