Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Now using setup and teardown in MarkdownExtra_Parser.

  • Loading branch information...
commit 2a1039982bf323ffa8bba5dd01adfc2aba9777a5 1 parent 48d9573
Michel Fortin authored
Showing with 15 additions and 8 deletions.
  1. +15 −8 markdown.php
23 markdown.php
View
@@ -1555,22 +1555,29 @@ function MarkdownExtra_Parser() {
var $footnote_counter = 1;
- function transform($text) {
+ function setup() {
#
- # Added clear to the new $html_hashes, reordered `hashHTMLBlocks` before
- # blank line stripping and added extra parameter to `runBlockGamut`.
+ # Setting up Extra-specific variables.
#
- # Clear the global hashes. If we don't clear these, you get conflicts
- # from other articles when generating a page which contains more than
- # one article (e.g. an index page that shows the N most recent
- # articles):
$this->footnotes = array();
$this->footnotes_ordered = array();
$this->abbr_desciptions = array();
$this->abbr_matches = array();
$this->footnote_counter = 1;
- return parent::transform($text);
+ return parent::setup();
+ }
+
+ function teardown($text) {
+ #
+ # Clearing Extra-specific variables.
+ #
+ return parent::teardown();
+
+ $this->footnotes = array();
+ $this->footnotes_ordered = array();
+ $this->abbr_desciptions = array();
+ $this->abbr_matches = array();
}
Please sign in to comment.
Something went wrong with that request. Please try again.