Wikipedia-regexp improved

Discussion corner for Developers of Serendipity.
Post Reply
stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Wikipedia-regexp improved

Post by stm999999999 » Sat Sep 19, 2009 1:51 am

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>'
    )
);
Ciao, Stephan

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: Wikipedia-regexp improved

Post by stm999999999 » Sat Sep 26, 2009 11:54 pm

JFTR: I cannot add this change into the csv. So, if someone would be so kind ...
Ciao, Stephan

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Wikipedia-regexp improved

Post by garvinhicking » Sun Sep 27, 2009 2:09 pm

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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: Wikipedia-regexp improved

Post by stm999999999 » Sat Dec 12, 2009 4:27 am

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?
Ciao, Stephan

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Wikipedia-regexp improved

Post by garvinhicking » Sat Dec 12, 2009 12:40 pm

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

stm999999999
Regular
Posts: 1517
Joined: Wed Mar 08, 2006 12:25 am
Location: Berlin, Germany
Contact:

Re: Wikipedia-regexp improved

Post by stm999999999 » Sat Dec 12, 2009 10:35 pm

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.
Ciao, Stephan

olexrina
Posts: 1
Joined: Wed Jan 13, 2010 1:09 pm

Re: Wikipedia-regexp improved

Post by olexrina » Fri Jan 15, 2010 9:14 am

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

Post Reply