From 2a1039982bf323ffa8bba5dd01adfc2aba9777a5 Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sun, 20 Apr 2008 23:22:44 -0400 Subject: [PATCH] Now using setup and teardown in MarkdownExtra_Parser. --- markdown.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/markdown.php b/markdown.php index 45b095cc..76c85f6b 100644 --- a/markdown.php +++ b/markdown.php @@ -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(); }