From 7764a90a026393e86091d5f01533f67f7930ded6 Mon Sep 17 00:00:00 2001 From: andi Date: Tue, 26 Apr 2005 20:56:30 +0200 Subject: footnotes fixed #277 #278 darcs-hash:20050426185630-9977f-908f1a39cd91cbe0cf5109db0e421a9806c47c41.gz --- inc/parser/xhtml.php | 37 ++++++++++++++++++++++++++----------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 39708db17..d79069bd6 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -31,8 +31,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $footnotes = array(); - var $footnoteIdStack = array(); - var $acronyms = array(); var $smileys = array(); var $badwords = array(); @@ -41,6 +39,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer { var $lastsec = 0; + var $store = ''; + + function document_start() { } @@ -195,19 +196,33 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function footnote_open() { $id = $this->_newFootnoteId(); $this->doc .= ''.$id.')'; - $this->footnoteIdStack[] = $id; - ob_start(); + + // move current content to store and record footnote + $this->store = $this->doc; + $this->doc = ''; + + $this->doc .= '
'; + $this->doc .= ''; + $this->doc .= $id.') '.DOKU_LF; } function footnote_close() { - $contents = ob_get_contents(); - ob_end_clean(); - $id = array_pop($this->footnoteIdStack); + # $contents = ob_get_contents(); + # ob_end_clean(); + # $id = array_pop($this->footnoteIdStack); - $contents = '
'. - $id.') ' .DOKU_LF .$contents. "\n" . '
' . DOKU_LF; - $this->footnotes[$id] = $contents; + # $contents = '
'. + # $id.') ' .DOKU_LF .$contents. "\n" . '
' . DOKU_LF; + # $this->footnotes[$id] = $contents; + + + $this->doc .= '
' . DOKU_LF; + + // put recorded footnote into the stack and restore old content + $this->footnotes[count($this->footnotes)] = $this->doc; + $this->doc = $this->store; + $this->store = ''; } function listu_open() { -- cgit v1.2.3