Plugin Directory

Changeset 633701

Timestamp:
12/03/2012 11:09:08 PM (12 years ago)
Author:
stephenh1988
Message:

Removes unautop and autop methods: use embed shortcodes for oembed. Remove tinymce editor if using MD. Adds public wrapper functions

Location:
wp-markdown/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-markdown/trunk/markdownify/markdownify.php

    r515458 r633701  
    903903   */
    904904  function handleTag_br() {
    905     $this->out("  \n".$this->indent, true);
     905    //$this->out("  \n".$this->indent, true);
     906    $this->out("<br>",true);
    906907    $this->parser->html = ltrim($this->parser->html);
    907908  }
  • wp-markdown/trunk/readme.txt

    r583428 r633701  
    55Requires at least: 3.1
    66Tested up to: 3.4.1
    7 Stable tag: 1.1.5
     7Stable tag: 1.1.
    88
    99Allows Markdown to be enabled in posts, comments and bbPress forums.
     
    4949== Changelog ==
    5050
     51
     52
     53
     54
     55
     56
     57
    5158= 1.1.5 =
     59
    5260* Fixes bug introduced in 1.1.4 where line breaks are stripped (affects code blocks).
    5361
     62
    5463= 1.1.4 =
     64
    5565* Fixes bug where oembed would not work. Thanks ot Michael & Vinicius
    5666* Adds a filters for MarkDown 'help' text: `wpmarkdown_help_text`
    5767* Support for MarkDown extra (currently not supported in pagedown previewer)
    5868
     69
    5970= 1.1.3 =
     71
    6072* Stable with WordPress 3.4
    6173* Fixed bug relating title attributes for links and images
    6274
     75
    6376= 1.1.2 =
     77
    6478* Fixed bug relating to comments by logged out users
    6579
     80
    6681= 1.1.1 =
     82
    6783* Fixed backslash bug
    6884
     85
    6986= 1.1 =
     87
    7088* Added option to replace TinyMCE with Markdown help bar on post editor
    7189
     90
    7291= 1.0 =
     92
    7393* Initial release
    7494
  • wp-markdown/trunk/wp-markdown.php

    r583428 r633701  
    33Plugin Name: WP-Markdown
    44Description: Allows you to use MarkDown in posts, BBPress forums and comments
    5 Version: 1.1.5
     5Version: 1.1.
    66Author: Stephen Harris
    77Author URI: http://HarrisWebSolutions.co.uk/blog
     
    6767        add_filter('pre_comment_content',array($this,'pre_comment_content'),5);
    6868        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 );
    7069
    7170        //Convert HTML to Markdown (posts, comments, BBPress front-end editing)
    72         add_filter( 'edit_post_content', array( $this, 'wpautop' ), 10, 2 );
    7371        add_filter( 'edit_post_content', array( $this, 'edit_post_content' ), 10, 2 );
    7472        add_filter( 'comment_edit_pre',  array( $this, 'edit_comment_content' ));
     
    243241    }
    244242
    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 \n
    256             $s = str_replace(array("<br />", "<br>", "<br/>"), "\n", $s);
    257 
    258             //replace </p> with \n\n
    259             $s = str_replace("</p>", "\n\n", $s);       
    260 
    261             $data['post_content'] = $s;
    262         }
    263         return $data;     
    264     }
    265243
    266244
     
    268246    * Convert HTML to MarkDown for editing
    269247    */
    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
    277249    //Post content
    278250    public function edit_post_content( $content, $id ) {
     
    318290    function pre_textarea_prettify_bbpress_reply(){
    319291        if($this->is_Markdownable('reply')){
     292
    320293            echo self::pre_textarea_prettify('bbp_reply_content');
    321294        }
     
    323296    function post_textarea_prettify_bbpress_reply(){
    324297        if($this->is_Markdownable('reply')){
     298
    325299            echo self::post_textarea_prettify('bbp_reply_content');
    326300        }
     
    328302    function pre_textarea_prettify_bbpress_topic(){
    329303        if($this->is_Markdownable('topic')){
     304
    330305            echo self::pre_textarea_prettify('bbp_topic_content');
    331306        }
     
    333308    function post_textarea_prettify_bbpress_topic(){
    334309        if($this->is_Markdownable('topic')){
     310
    335311            echo self::post_textarea_prettify('bbp_topic_content');
    336312        }
     
    432408}
    433409
     410
     411
     412
     413
     414
     415
     416
     417
     418
     419
    434420require_once( dirname( __FILE__) . '/markdown-extra.php' );
    435421require_once( dirname( __FILE__) . '/markdownify/markdownify.php' );
Note: See TracChangeset for help on using the changeset viewer.