<?php
/*
Plugin Name: Markdown for bbPress
Description: Runs posts through Markdown filter before saving. You'll need to install <a href="http://michelf.com/projects/php-markdown/" title="PHP Markdown">Markdown</a> separately, either as a <a href="http://bbpress.org/documentation/customization/">bbPress plugin</a> or in Wordpress (if you're running Wordpress simultaneously).
Author URI: http://samm.dreamhosters.com/bbpress/plugins/ 
Version: 0.1
*/

// if (! defined( 'MARKDOWN_VERSION' )) die('It looks like Markdown is not installed.');

/*	Default filters :
	
	add_filter('pre_post', 'trim');
	add_filter('pre_post', 'encode_bad');
	add_filter('pre_post', 'balanceTags');
	add_filter('pre_post', 'stripslashes', 40); // KSES doesn't like escaped atributes
	add_filter('pre_post', 'bb_filter_kses', 50);
	add_filter('pre_post', 'addslashes', 55);
	add_filter('pre_post', 'bb_autop', 60);
*/

// remove_filter('pre_post', 'encode_bad');
remove_filter('pre_post', 'balanceTags');
remove_filter('pre_post', 'bb_autop'); // @ 60
add_filter('pre_post', 'Markdown', 60); // like autop
add_filter('pre_post', 'balanceTags'); // moved to end (?)

?>