I'm using Textile for content editing on a site. Only trusted users have access to editing.
I want to insert insert gists from GitHub: <script src="http://gist.github.com/#####.js"></script>
but Textile removes these with: "[removed][removed]
".
I've searched through the Textile PHP class for how and 开发者_StackOverflow社区where it detects this and removes it, but it escapes me. I found the Textile tag filtering for Ruby, is there anything similar for the PHP class?
You can do it using regexp, with the function preg_replace():
/<[^<]+?>/i
If you dont need the replace, just use strip_tags() function.
Ok, I feel like an idiot. It was CodeIgniter filtering the $POST data that removed it.
For reference: Textile does not automatically remove <script>
or other tags.
精彩评论