;) Or we could just wait and hope my LinkHook changes to MW work out.
$parser->setLinkHook( '/^[{$tc}]+:[:=]/', callbackname, SLH_PATTERN );
# Note that this list of arguments is just an example, the real list
will be very different
function callbackname( $markers, $linkText, $displayText = '',
$leadingColon = false ) {
if( $leadingColon ) return true; # Parse as normal link
$properties = preg_split( '/:[:=]/', $linkText );
$text = $markers->expand( array_pop( $properties ) );
...
return $text;
}
~Daniel Friesen(Dantman, Nadir-Seen-Fire) of:
-The Nadir-Point Group (http://nadir-point.com)
--It's Wiki-Tools subgroup (http://wiki-tools.com)
--The ElectronicMe project (http://electronic-me.org)
--Games-G.P.S. (http://ggps.org)
-And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
--Animepedia (http://anime.wikia.com)
--Narutopedia (http://naruto.wikia.com)
Markus Krötzsch wrote:
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
------------------------------------------------------------------------
-------------------------------------------------------------------------
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
-------------------------------------------------------------------------
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