How to Sanitize HTML and CSS in Ruby

Courtesy Ruby Inside  Thu, 01/01/2009 - 01:41

sanitize.png

If you've developed an application that displays user-supplied text in a Web browser, it's always possible that the user has entered some crazy HTML (or even CSS) that will break your site's layout.

While it's easy to remove all HTML from a piece of text, you might want them to use certain subsets of HTML to format their content, so you need to sanitize the user supplied HTML and CSS.

Luckily, two Ruby libraries have...


 

More related items

WordPress SyntaxHighlighter font size fix - Matthew...
I use WordPress for this web site. To pretty up source code examples in my posts, I use the excellent SyntaxHighlighter Evolved WordPress plugin. The WordPress theme I use, Fluid Blue, does...

Elliot Haughin's Blog: CodeIgniter 1.7.x, 'Core' 2.0,...
Elliot Haughin has posted some of his thoughts about the huge amount of changes the CodeIgniter framework project has been going through lately including moves to Bitbucket, the "Core"...

Vim for Programmers on Slideshare - Andrei Zmievski
A few years ago, I was considering what proposal to submit to the Vancouver PHP Conference. The usual slate of “how to do this and that in PHP” was becoming a bit tired, so I decided to...


 

Post new comment

The content of this field is kept private and will not be shown publicly.
computer-internet.marc8.com