Page 1 of 1

Wikipedia-regexp improved

Posted: Sat Sep 19, 2009 1:51 am
by stm999999999
hello,

the wikipedia regepx in the regexps-Plugin does not handle things like

Code: Select all

[(wiki-source|another title)]
here is my new code:

Code: Select all

<?php
// Wiki-Reference.
//
$regexpArray = array(
    'SearchArray'=>array(
		"/\[\((.*)\|(.*)\)\]/U",
		"/\[\((.*)\)\]/U",
	),
    'ReplaceArray'=>array(
	    '<a href="http://de.wikipedia.org/wiki/\\1" target="_blank">\\2</a>',
		'<a href="http://de.wikipedia.org/wiki/\\1" target="_blank">\\1</a>'
    )
);

Re: Wikipedia-regexp improved

Posted: Sat Sep 26, 2009 11:54 pm
by stm999999999
JFTR: I cannot add this change into the csv. So, if someone would be so kind ...

Re: Wikipedia-regexp improved

Posted: Sun Sep 27, 2009 2:09 pm
by garvinhicking
Hi!

I think the regexp could be combined into one, making the| ... optional. We should look into that, but currently I have no easy testcases for that.

Also the matter still lies at hand to make the regexpmarkup plugin enable/disable certain regexps. Sadly the plugin caches those and it's not easy to enable/disable them without having a huge performance impact... :-/

Regards,
Garvin

Re: Wikipedia-regexp improved

Posted: Sat Dec 12, 2009 3:27 am
by stm999999999
after an update of this plugin for my installations, I fall into this trap again: My use of [(wiki-source|another title)] does not work anymore and I try erverything to rearange the plugin order before I remember that the original plugin does not have my improved code and it is not an interfering of different plugins. :-(

So, if no one can merge it into one regex (I am not firm enough), is it possible to put my code into the CVS?

BTW, any idea how to make it possible to use other than german wikipedia as an option? Perhaps it would be the best to export this whole function to a single plugin? IMHO wikipedia-links are an important markup thing, or?

Re: Wikipedia-regexp improved

Posted: Sat Dec 12, 2009 11:40 am
by garvinhicking
Hi!

I thought there is a specific wikimarkup plugin, independently from the regexpmarkup one?!

Regards,
Garvin

Re: Wikipedia-regexp improved

Posted: Sat Dec 12, 2009 9:35 pm
by stm999999999
AFAIK the wiki-plugin is for blog-intern linking with wiki-style, like ((staticpage-title)) and so.

it has nothing to do with this special and wellknown wiki called wikipedia :-)

and I think these are two structural different things.

Re: Wikipedia-regexp improved

Posted: Fri Jan 15, 2010 8:14 am
by olexrina
What are some sister projects to Wikipedia that are less anal about the exact wording of phrases? I'm getting ticked off at the way they're running Wikipedia now. I liked it the old way. Are there any wiki sites--any at all--that are like Wikipedia used to be?
__________________
affiliateelite ~ affiliateelite.com ~ adgooroo ~ adgooroo.com