Hi
Small patch. Maybe not the best solution, but simple and not very dirty. Makes a merge of correct template args to recover entire wikilinks [[(...)]]
Cordialy
Emmanuel Engelhart
Emmanuel Engelhart wrote:
Small patch. Maybe not the best solution, but simple and not very dirty. Makes a merge of correct template args to recover entire wikilinks [[(...)]]
It has a little bug:
Suppose you have something like
{{template|var1=Here is a [[link]] and here is [[link|another]].}}
Your patch would not work properly in this case. Please could you change this:
+ if((strpos($args[$i], "[[") !== false) && (strpos($args[$i], "]]") === false) ) {
in such a way that it essentially says "if number of '[['s in $args[$i] greater than number of ']]'s"?
Additionally, please use tabs at the beginning of lines, and please use 'diff -u' to create your patches.
Thanks! Timwi
On Sat, 31 Jul 2004 14:10:06 +0100 Timwi timwi@gmx.net wrote:
Emmanuel Engelhart wrote:
Small patch. Maybe not the best solution, but simple and not very dirty. Makes a merge of correct template args to recover entire wikilinks [[(...)]]
It has a little bug:
Suppose you have something like
{{template|var1=Here is a [[link]] and here is [[link|another]].}}
Your patch would not work properly in this case. Please could you change this:
- if((strpos($args[$i], "[[") !== false) && (strpos($args[$i], "]]") ===
false) ) {
in such a way that it essentially says "if number of '[['s in $args[$i] greater than number of ']]'s"?
Additionally, please use tabs at the beginning of lines, and please use 'diff -u' to create your patches.
True, new version correcting this bug.
Emmanuel
Emmanuel Engelhart wrote:
True, new version correcting this bug.
Again, *please* use tabs to indent lines in the future. I've fixed this for you now and committed it.
Oh, and I've also changed for ( $i = 0; $i < $argc; $i++ ) { to for ( $i = 0; $i < $argc-1; $i++ ) {
because once there's only a single argument left, you don't want to try to merge it with the non-existant next.
Thanks, Timwi
On Sat, 31 Jul 2004 15:10:53 +0100 Timwi timwi@gmx.net wrote:
Emmanuel Engelhart wrote:
True, new version correcting this bug.
Again, *please* use tabs to indent lines in the future. I've fixed this for you now and committed it.
Oh, and I've also changed for ( $i = 0; $i < $argc; $i++ ) { to for ( $i = 0; $i < $argc-1; $i++ ) {
because once there's only a single argument left, you don't want to try to merge it with the non-existant next.
Ok, sorry for not using tabs... but sometimes, my emacs php-mode seems to have difficulties...But I will solve the problem or understand the mode ;)
Emmanuel
Timwi wrote:
Emmanuel Engelhart wrote:
True, new version correcting this bug.
Again, *please* use tabs to indent lines in the future. I've fixed this for you now and committed it.
Seems pretty straightforward, I've gone ahead and copied it to the 1.3 branch and installed it.
-- brion vibber (brion @ pobox.com)
Hi all,
Le Sunday 01 August 2004 05:22, Brion Vibber a écrit :
Timwi wrote:
Emmanuel Engelhart wrote:
True, new version correcting this bug.
Seems pretty straightforward, I've gone ahead and copied it to the 1.3 branch and installed it.
-- brion vibber (brion @ pobox.com)
Many thanks to Emmanuel and Brion for this fix. This bug was quite annoying.
Yann
On Sun, 1 Aug 2004 11:37:45 +0200 Yann Forget yann@forget-me.net wrote:
Hi all,
Le Sunday 01 August 2004 05:22, Brion Vibber a écrit :
Timwi wrote:
Emmanuel Engelhart wrote:
True, new version correcting this bug.
Seems pretty straightforward, I've gone ahead and copied it to the 1.3 branch and installed it.
-- brion vibber (brion @ pobox.com)
Many thanks to Emmanuel and Brion for this fix. This bug was quite annoying.
And Timwi... of course.
Emmanuel
wikitech-l@lists.wikimedia.org