problem with Sanitize.clean()

1 view
Skip to first unread message

bt.san...@gmail.com

unread,
Nov 5, 2009, 9:58:58 AM11/5/09
to bangal...@googlegroups.com, ruby-on-rails-programming-with-passion, rubyonra...@googlegroups.com
hi ,

I have used Sanitize.clean() to clean up html tags, but I want to preserve some of them, For that I have given, return Sanitize.clean(soup_string.to_s, :elements => ['div','p','span','table','tr','th','td','blockquote', 'br', 'cite', 'code', 'dd', 'dl', 'dt','em','i', 'li', 'ol','pre', 'q', 'small', 'strike','strong', 'sub','sup', 'u', 'ul','tbody','center']) .. But the problem is that I want to preserve right justification also, where i cannot define the custom style as <right></right> is not a valid tag...

For center justification to preserve I have given... tag.contents = ['<center>'+tag.contents.to_s+'</center>'] if (tag['style'] =~ /text-align:center/) where it recognizes center, But how to allow the right justification, please help me.

Thanks,
Santosh
Reply all
Reply to author
Forward
0 new messages