On Freitag, 8. August 2008, Rolf Lampa wrote:
> Markus Krötzsch skrev:
> > The default pattern now is
> >
> > It covers anything but syntax with [ and ] in property values. The
> > alternative (optional) pattern is
> >
> > /\[\[                 # Beginning of the link
> > (?:([^:][^]]*):[=:])+ # Property name (or a list of those)
> > (                     # After that:
> >   (?:[^|\[\]]         #   either normal text (without |, [ or ])
> >
> >   |\[\[[^]]*\]\]      #   or a [[link]]
> >   |\[[^]]*\]          #   or an [external link]
> >
> > )*)                   # all this zero or more times
>
> Except for starting up the '[[Property::' (and closing it with ']]') it
> doesn't seem to be very important at all what's in the
> '::<value>]]'-part, except for making sure that brackets (if any) are in
> balance.
>
> > (?:\|([^]]*))?        # Display text (like "text" in [[link|text]]),
> > optional \]\]                  # End of link
> > /xu
> >
> > It covers nested [[...]] and [...], and has special treatment for the
> > final | (to distinguish it from | in nested links).
>
> Ok, one must keep track of which bracket pair is "owning" a pipe, but
> that's not too hard. But what would happen if allowing for nested SMW
> properties? (a SMW property inside another SMW property, which sometimes
> would be useful). Example:
>
>   [[Summary::Article summaries would benefit from having nested
>   [[has nested::SMW property|SMW properties]]]] in it's summary
>   part, apart from regular [[wiki link]]s.]]
>
> If this could be allowed, one could allow for a nesting depth of, say,
> one level. Or, would a nested SMW property eventually choke the
> internals of SMW? :)

We have had a regexp that matches level-one netstings of [[]] and []. That is 
fairly easy to do. The problem is that PHP's library PCRE crashes Apache due 
to stack size problems for such regexps, at least if the matches exceed a 
certain length. This still happens in the current code if you have annotation 
values around 65kb long, but it happened much earlier before. So, yes, we 
know how to write the code that *should* do the proper thing; it just crashes 
on PHP.

We may be able to recover support for nested links by using completely 
different functions instead of the problematic PCRE functions. 

Regards,

Markus

>
> Regards,
>
> // Rolf Lampa
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge Build the coolest Linux based applications with Moblin SDK & win
> great prizes Grand prize is a trip for two to an Open Source event anywhere
> in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Semediawiki-devel mailing list
> Semediawiki-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    [EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to