0

Pretty self explanatory, I want to allow html from users to be displayed on a web page.

Ideally it should allow elements like <p><strong><em><a><ul><li> while disallowing ids, classes, <script>, <style>, inline javascript and so on. Ensuring HTML validity is a strong plus. HTML (as opposed to XHTML, or at least being able to choose) would be nice also.

Of course, I could use something like MarkDown, but i'd prefer a system that didn't require users to learn new skills if possible.

Sorry if this question is a duplicate, I did check first but found nothing. A quick google obviously had some results, but I only have the developers word that they are any good (i.e. secure).

Free/Open source solutions preferred.

Cœur
  • 37,241
  • 25
  • 195
  • 267
DaedalusFall
  • 8,335
  • 6
  • 30
  • 43
  • Related, maybe useful: http://stackoverflow.com/questions/5859294/keep-user-generated-content-from-breaking-layout/5859414 – Wesley Murch May 04 '11 at 10:27

1 Answers1

3

i'd prefer a system that didn't require users to learn new skills if possible.

Assuming your users know basic html?

I use HTMLPurifier, and no complaints so far.

Zirak
  • 38,920
  • 13
  • 81
  • 92