summaryrefslogtreecommitdiff
path: root/inc/parser/renderer.php
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-08-05 00:01:00 +0200
committerchris <chris@jalakai.co.uk>2006-08-05 00:01:00 +0200
commit5587e44c45f200479ef9ab3bd8f0264647941483 (patch)
treecc8ace5822717fbbfe4ab27f54c30937fb6f2171 /inc/parser/renderer.php
parent03c4aec3c817c51eda2cf5c241f76e3bef585799 (diff)
downloadrpg-5587e44c45f200479ef9ab3bd8f0264647941483.tar.gz
rpg-5587e44c45f200479ef9ab3bd8f0264647941483.tar.bz2
fix for bug #701, lists in footnotes in lists
added Doku_Handler_Nest class & "nest" render instruction These allows render instructions to be nested within the "nest" render instruction, isolating them from the outer list of render instructions. Not being able to do this is a particular problem for the current Doku_Handler_* classes as they process the list of intructions generated during their life without any recognition that some of the instructions may not belong to them being nested within another syntax mode. This also makes it easier for plugins to generate cacheable nested instructions rather than using the expensive p_render() function which has to create a new renderer. darcs-hash:20060804220100-9b6ab-ccd051e287af45afacdb1efecb8d9beb376276cb.gz
Diffstat (limited to 'inc/parser/renderer.php')
-rw-r--r--inc/parser/renderer.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 931be6ceb..f9dcaab7b 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -1,6 +1,6 @@
<?php
/**
- * Renderer for XHTML output
+ * Renderer output base class
*
* @author Harry Fuecks <hfuecks@gmail.com>
* @author Andreas Gohr <andi@splitbrain.org>
@@ -35,6 +35,23 @@ class Doku_Renderer {
}
}
+ /**
+ * handle nested render instructions
+ * this method (and nest_close method) should not be overloaded in actual renderer output classes
+ */
+ function nest($instructions) {
+
+ foreach ( $instructions as $instruction ) {
+ // execute the callback against ourself
+ call_user_func_array(array(&$this, $instruction[0]),$instruction[1]);
+ }
+ }
+
+ // dummy closing instruction issued by Doku_Handler_Nest, normally the syntax mode should
+ // override this instruction when instantiating Doku_Handler_Nest - however plugins will not
+ // be able to - as their instructions require data.
+ function nest_close() {}
+
function document_start() {}
function document_end() {}