Go to the FreeLists Home Page Home Signup Help Login
 



[dokuwiki] || [Date Prev] [04-2006 Date Index] [Date Next] || [Thread Prev] [04-2006 Thread Index] [Thread Next]

[dokuwiki] Re: $pos and Plugins & PType

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 06 Apr 2006 09:17:32 +0200
Chris Smith writes:

Hi,

Plugins and PType are a mess[1].

$pos is faithfully kept intact through the whole rendering process, but AFAIK is not used anywhere outside the lexer. I believe it represents the character position in the wiki page of the location of the first character in the syntax pattern that started the chain of events that lead to the particular rendering instruction being created.

$pos is used for the section editing so we really need it.

I'd like to swap it for l"lexer state" ( at least for the plugin instructions). That will give the block handler some indication of what is happening with the plugin and allow it to:
- open a block/stack on enter
- do nothing on matched and unmatched
- close a block/stack on exit


I'd also like to remove the unused "plugin_$name_open", "plugin_$name_close" array entries. These aren't used anywhere at present and can not be used without a revamp of the way syntax modes are used by the handler and renderer. That is the syntax mode is used as the plugin class name. To add any extra information to it would stop the plugin being called and probably cause a fatal php error.

Without looking at the code, I agree with you that the whole block handling isn't really elegant. Everything that will improve this is very welcome. I can not really say anything to the proposed solution without having a look at the code (which I probably can't do until next week) but it sounds reasonable as long as we can maintain the $pos var for section editing.


Andi


-- DokuWiki mailing list - more info at http://wiki.splitbrain.org/wiki:mailinglist




[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.