Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Commit

Permalink
Add Parsedown extension so that it doesn't mess with quotes and HTML …
Browse files Browse the repository at this point in the history
…special chars (WP does this on its own)
  • Loading branch information
Robin Adrianse committed Mar 1, 2015
1 parent 2e546b0 commit cf2067f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions parsedown-wp.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
require_once __DIR__ . '/Parsedown/Parsedown.php';
require_once __DIR__ . '/Parsedown/ParsedownExtra.php';

class Parsedown_WP_Parser extends ParsedownExtra
{
protected function inlineSpecialCharacter( $excerpt )
{
// Do nothing. WordPress handles HTML special characters
// and curly quotes by default.
}
}

class Parsedown_WP
{
private $parser;
Expand All @@ -70,13 +79,12 @@ class Parsedown_WP

public function __construct()
{
//add_action( 'init', array( $this, 'init' ) );
$this->init();
add_action( 'init', array( $this, 'init' ) );
}

public function init()
{
$this->parser = new ParsedownExtra();
$this->parser = new Parsedown_WP_Parser();

// These filters are taken directly from PHP Markdown Extra by Michel
// Fortin to ensure it's a 100% drop-in solution.
Expand Down

0 comments on commit cf2067f

Please sign in to comment.