From 5587e44c45f200479ef9ab3bd8f0264647941483 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 5 Aug 2006 00:01:00 +0200 Subject: 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 --- inc/parser/renderer.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'inc/parser/renderer.php') 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 @@ * @author Andreas Gohr @@ -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() {} -- cgit v1.2.3