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

I use the PHP markup library: http://michelf.com/projects/php-markdown/ and the Javascript markdown library: http://attacklab.net/showdown/

I want to ban all HTML, both versions of markdowns seem to allow this indiscriminately. My first attempt was to simply avoid all html objects before submitting to markdowns. However, it also speeds up the syntax <hyperlink>and <email>, which is very useful.

I would like to avoid all HTML (not delete), but save all the markup syntaxes.

+3
source share
1 answer

You have two options.

-, HTML, - . lib_filter Cal Henderson ( Flickr) , , - , HTMLPurifier.

-, HTML, , htmlspecialchars, , . .;)

, PHP, Javascript. Ajax- - script, - , . .

+3
source

Source: https://habr.com/ru/post/1749494/


All Articles