On 7 Feb 2012, at 23:04, Chris Green wrote:
A typical syntax plugin with a format like:- <plugin:param1=abc¶m2=xyz>Some text here</plugin> Will handle states DOKU_LEXER_ENTER, DOKU_LEXER_UNMATCHED andDOKU_LEXER_EXIT in its handle() function, is there any way to communicatebetween them? E.g. will class variables be available between calls or is each call of handle() in a different instance of the syntax plugin class?
Do you need the information in the handler or the renderer?I've needed to propagate data from ENTER to EXIT when rendering in the past. I've done this by:
1) Creating a class to hold the data I need for each handler state. These are used within the return from handle();
2) Registering a PARSER_HANDLER_DONE action callback;3) Using the above to find the [ 'plugin' ][ 'myplugin' ] [ DOKU_LEXER_ENTER ] instructions and copying the relevant data to the corresponding [ 'plugin' ][ 'myplugin' ][ DOKU_LEXER_EXIT ] instruction.
I did originally try storing information within the class but I found this was not robust.
Chris Tapp opensource@xxxxxxxxxxxx www.keylevel.com -- DokuWiki mailing list - more info at http://www.dokuwiki.org/mailinglist