Support » Plugin: Markdown on Save Improved » [Plugin: Markdown on Save Improved] Linebreaks aren't always ignored.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Matt Wiebe

    (@mattwiebe)

    Mark’s initial plugin took a hybrid approach where it’s run through Markdown, but then paragraph tags are stripped and the remaining text is run through the wpautop filter, which inserts paragraphs for double linebreaks and br tags for single linkebreaks.

    Is that what you’re describing?

    Plugin Author Matt Wiebe

    (@mattwiebe)

    This should be fixed now. Now overriding WP’s usage of wpautop.

    I’ve altered the code a bit to have it check whether the wpautop filter is being used. Sometimes I want to disable this for particular themes and this makes your plugin a little less agressive when it comes to using that filter.

    So if a user in their functions.php file removes the filter,

    remove_filter ('the_content', 'wpautop');

    then this code will honor that:

    public function maybe_default_formatting($content) {
    	if ( ! $this->is_markdown( get_the_ID() ) ) {
    		if( has_filter( 'wpautop' ) ) {
    			$content = wpautop($content);
    		}
    	}
    	return $content;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Markdown on Save Improved] Linebreaks aren't always ignored.’ is closed to new replies.