summaryrefslogtreecommitdiff
path: root/inc/parser/xhtml.php
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-04-26 20:56:30 +0200
committerandi <andi@splitbrain.org>2005-04-26 20:56:30 +0200
commit7764a90a026393e86091d5f01533f67f7930ded6 (patch)
tree788178cfbe20787f798242b97caa889d2d3f80a5 /inc/parser/xhtml.php
parent27a2b0851e6b7273beab68070c1e639454918da7 (diff)
downloadrpg-7764a90a026393e86091d5f01533f67f7930ded6.tar.gz
rpg-7764a90a026393e86091d5f01533f67f7930ded6.tar.bz2
footnotes fixed #277 #278
darcs-hash:20050426185630-9977f-908f1a39cd91cbe0cf5109db0e421a9806c47c41.gz
Diffstat (limited to 'inc/parser/xhtml.php')
-rw-r--r--inc/parser/xhtml.php37
1 files changed, 26 insertions, 11 deletions
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 .= '<a href="#fn'.$id.'" name="fnt'.$id.'" class="fn_top">'.$id.')</a>';
- $this->footnoteIdStack[] = $id;
- ob_start();
+
+ // move current content to store and record footnote
+ $this->store = $this->doc;
+ $this->doc = '';
+
+ $this->doc .= '<div class="fn">';
+ $this->doc .= '<a href="#fnt'.$id.'" name="fn'.$id.'" class="fn_bot">';
+ $this->doc .= $id.')</a> '.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 = '<div class="fn"><a href="#fnt'.
- $id.'" name="fn'.$id.'" class="fn_bot">'.
- $id.')</a> ' .DOKU_LF .$contents. "\n" . '</div>' . DOKU_LF;
- $this->footnotes[$id] = $contents;
+ # $contents = '<div class="fn"><a href="#fnt'.
+ # $id.'" name="fn'.$id.'" class="fn_bot">'.
+ # $id.')</a> ' .DOKU_LF .$contents. "\n" . '</div>' . DOKU_LF;
+ # $this->footnotes[$id] = $contents;
+
+
+ $this->doc .= '</div>' . 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() {