Forum OpenACS Development: Re: Problem with includelet in xowiki

Collapse
Posted by Gustaf Neumann on
The regular expressions are used for extracting included content from html pages. If the RE is made greedy, it might pick up the closing braces from a possibly following includelet definition - not desired either.

While it is certainly true that Tcl does not require whitespace to determine the correct closing braces, one should remember, that Tcl does not use regular expression to parse its syntax. Parsing of balanced braces in the general case is a well-known limitation of regular grammars. One needs at least context free grammars for this task. From the parsing point of view, it would be better to encode e.g. the wiki-markup in HTML (DIVS, SPANS), or to use a different parser (e.g. write a small parse in C), or to use one of the many wiki-style parsers around. All these approaches have some properties not desired either.

For now, i have improved the RE slightly to handle the mentioned cases correctly (in the 5-3 branch and on cvs head). This is no general solution, but pushes the boundary a little further. One should not use two closing curly braces next to each other within an includelet definition.

Note that the problem is as well a bigger problem for the adp includelets, since the pure xowiki includelets use the "-parameter value" syntax, which is less prone to multiple curly braces. Often, it helps to replace double quotes by braces.