How can I disallow all HTML using markdown (PHP and JS)?

Posted by peterjwest on Stack Overflow See other posts from Stack Overflow or by peterjwest
Published on 2010-06-10T23:17:38Z Indexed on 2010/06/10 23:23 UTC
Read the original article Hit count: 120

Filed under:
|
|
|

I'm using the PHP markdown library: http://michelf.com/projects/php-markdown/ and the Javascript markdown library: http://attacklab.net/showdown/

I want to disallow all HTML, both the versions of markdown seem to allow it indiscriminately. My first attempt was simply to escape all html entities before feeding into markdown. However this also escapes the <hyperlink> and <email> syntax, which is very useful.

I'd like to escape all HTML (not remove) but preserve all markdown syntax.

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript