[dokuwiki] Re: darcs patch: parenthesis_escaper_fix

On Wed, Dec 19, 2007 at 10:52:41AM +0000, stephane.chazelas@xxxxxxxxxxx wrote:
> Wed Dec 19 10:38:58 GMT 2007  stephane.chazelas@xxxxxxxxxxx
>   * parenthesis_escaper_fix
[...]

Hiya,

sorry for the lack information in there. It was my first attempt
at using darcs to send a patch. I thought I'd have had an
opportunity to edit the email before sending it.

I've submitted a new "task" at bugs.splitbrain.org: 1302 for it.

I've run into the problem when trying to improve the "cli"
plugin.

I was using an ENTER regexp like:

<cli(?:"(?:\\.|[^\\"])*"|[^"\\])*>\r?\n?(?=.*?</cli>)

To allow things like: <cli prompt="\"">

But that caused erratic behavior.

I eventually found out that it was due to the
_getCompoundedRegex() function that improperly escaped the
parenthesis.

It was turning my regexp into:

'<cli(?:"(?:\\.|[^\\"])*"|[^"\\]\)*>\r?\n?(?=.*?<\/cli>)'
(note the \) above that shouldn't be there).

The patch I sent is an attempt to fix it. I also simplifies the
code slightly and might make it faster.

Please tell me what you think.

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

Other related posts: