Changeset 633701
- Timestamp:
- 12/03/2012 11:09:08 PM (12 years ago)
- Location:
- wp-markdown/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
wp-markdown/trunk/markdownify/markdownify.php
r515458 r633701 903 903 */ 904 904 function handleTag_br() { 905 $this->out(" \n".$this->indent, true); 905 //$this->out(" \n".$this->indent, true); 906 $this->out("<br>",true); 906 907 $this->parser->html = ltrim($this->parser->html); 907 908 } -
wp-markdown/trunk/readme.txt
r583428 r633701 5 5 Requires at least: 3.1 6 6 Tested up to: 3.4.1 7 Stable tag: 1.1. 57 Stable tag: 1.1. 8 8 9 9 Allows Markdown to be enabled in posts, comments and bbPress forums. … … 49 49 == Changelog == 50 50 51 52 53 54 55 56 57 51 58 = 1.1.5 = 59 52 60 * Fixes bug introduced in 1.1.4 where line breaks are stripped (affects code blocks). 53 61 62 54 63 = 1.1.4 = 64 55 65 * Fixes bug where oembed would not work. Thanks ot Michael & Vinicius 56 66 * Adds a filters for MarkDown 'help' text: `wpmarkdown_help_text` 57 67 * Support for MarkDown extra (currently not supported in pagedown previewer) 58 68 69 59 70 = 1.1.3 = 71 60 72 * Stable with WordPress 3.4 61 73 * Fixed bug relating title attributes for links and images 62 74 75 63 76 = 1.1.2 = 77 64 78 * Fixed bug relating to comments by logged out users 65 79 80 66 81 = 1.1.1 = 82 67 83 * Fixed backslash bug 68 84 85 69 86 = 1.1 = 87 70 88 * Added option to replace TinyMCE with Markdown help bar on post editor 71 89 90 72 91 = 1.0 = 92 73 93 * Initial release 74 94 -
wp-markdown/trunk/wp-markdown.php
r583428 r633701 3 3 Plugin Name: WP-Markdown 4 4 Description: Allows you to use MarkDown in posts, BBPress forums and comments 5 Version: 1.1. 55 Version: 1.1. 6 6 Author: Stephen Harris 7 7 Author URI: http://HarrisWebSolutions.co.uk/blog … … 67 67 add_filter('pre_comment_content',array($this,'pre_comment_content'),5); 68 68 add_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 ); 69 add_filter( 'wp_insert_post_data', array( $this, 'un_wpautop' ), 11, 2 );70 69 71 70 //Convert HTML to Markdown (posts, comments, BBPress front-end editing) 72 add_filter( 'edit_post_content', array( $this, 'wpautop' ), 10, 2 );73 71 add_filter( 'edit_post_content', array( $this, 'edit_post_content' ), 10, 2 ); 74 72 add_filter( 'comment_edit_pre', array( $this, 'edit_comment_content' )); … … 243 241 } 244 242 245 //Replace <p> tags that are added when converting markdown --> HTML.246 //These are added back in when editing (see $this->wpautop)247 //They remain stripped for displaying (so oembed works).248 public function un_wpautop($data,$postarr){249 if($this->is_Markdownable($data['post_type'])|| ($data['post_type'] =='revision' && $this->is_Markdownable($data['post_parent']))){250 $s = $data['post_content'];251 252 //remove all <p>253 $s = str_replace("<p>", "", $s);254 255 //replace <br /> with \n256 $s = str_replace(array("<br />", "<br>", "<br/>"), "\n", $s);257 258 //replace </p> with \n\n259 $s = str_replace("</p>", "\n\n", $s);260 261 $data['post_content'] = $s;262 }263 return $data;264 }265 243 266 244 … … 268 246 * Convert HTML to MarkDown for editing 269 247 */ 270 //Add <p> tags for markdown. These a replaced prior to saving to database. See $this->un_wpautop. 271 public function wpautop($content, $id){ 272 if($this->is_Markdownable((int) $id)){ 273 $content = wpautop($content); 274 } 275 return $content; 276 } 248 277 249 //Post content 278 250 public function edit_post_content( $content, $id ) { … … 318 290 function pre_textarea_prettify_bbpress_reply(){ 319 291 if($this->is_Markdownable('reply')){ 292 320 293 echo self::pre_textarea_prettify('bbp_reply_content'); 321 294 } … … 323 296 function post_textarea_prettify_bbpress_reply(){ 324 297 if($this->is_Markdownable('reply')){ 298 325 299 echo self::post_textarea_prettify('bbp_reply_content'); 326 300 } … … 328 302 function pre_textarea_prettify_bbpress_topic(){ 329 303 if($this->is_Markdownable('topic')){ 304 330 305 echo self::pre_textarea_prettify('bbp_topic_content'); 331 306 } … … 333 308 function post_textarea_prettify_bbpress_topic(){ 334 309 if($this->is_Markdownable('topic')){ 310 335 311 echo self::post_textarea_prettify('bbp_topic_content'); 336 312 } … … 432 408 } 433 409 410 411 412 413 414 415 416 417 418 419 434 420 require_once( dirname( __FILE__) . '/markdown-extra.php' ); 435 421 require_once( dirname( __FILE__) . '/markdownify/markdownify.php' );
Note: See TracChangeset
for help on using the changeset viewer.