WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
Paragraph editing not working properly (+fix) (2 posts)

  1. Joost
    Member
    Posted 3 years ago #

    When using the plugin to edit specific paragraphs, it does not recognize paragraphs properly. This is due to the fact that the regex in the function split (fields/post.php, around line 143) does not take line-breaks into account. This is easily remedied by adding an "s" at the end of the expression. It makes sure that line breaks are also matched by the . (dot) operator.

    protected function split( $content, $autop = false ) {
    		if ( $autop )
    			$content = wpautop( $content );
    
    		preg_match_all( "#<p.*?>(.*?)</p>#s", $content, $matches );
    
    		return $matches[1];
    	}

    Regards,
    Joost.

    http://wordpress.org/extend/plugins/front-end-editor/

  2. scribu
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Joost,

    Thanks for providing a fix. However, in the development version (2.0-alpha2) I'm using PHP's DOM extension to parse paragraphs.

    Please try it out.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic