Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed constructor

  • Loading branch information...
commit abb9e852665e909f04b0edf9c02b46663f20e208 1 parent 901b334
@ikwattro authored
Showing with 5 additions and 17 deletions.
  1. +4 −7 Markdown/KwattroMarkdown.php
  2. +1 −10 Parser/Parser.php
View
11 Markdown/KwattroMarkdown.php
@@ -62,8 +62,6 @@ class KwattroMarkdown
public function __construct(array $extensions_config, $renderer)
{
$this->configure($extensions_config, $renderer);
-
- $this->setUpMarkdown();
}
/**
@@ -85,10 +83,7 @@ public function render($text, array $options = array(), $renderer = null)
*/
public function setUpMarkdown()
{
- if(!$this->parser instanceof Parser)
- {
- $this->parser = new Parser();
- }
+ $this->parser = new Parser($this->renderer, $this->extensions);
}
/**
@@ -98,7 +93,7 @@ public function setUpMarkdown()
*/
public function transform($text)
{
- return $this->parser->render($this->renderer, $this->extensions);
+ return $this->parser->render($text, $this->extensions);
}
/**
@@ -125,6 +120,8 @@ public function configure(array $extensions = array(), $renderer = null)
$this->renderer = new $this->renderers[$renderer];
}
}
+
+ $this->setUpMarkdown();
}
/**
View
11 Parser/Parser.php
@@ -16,14 +16,5 @@
class Parser extends Markdown
{
- /**
- * Create a new Parser instance and configure the enabled extensions
- *
- * @param array $extensions
- * @param string $renderer
- */
- public function __construct()
- {
- parent::__construct();
- }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.