MewBot is introducing errors

Fragment of a discussion from User talk:Rua
Jump to navigation Jump to search

I modified Module:parameters so that it strips leading and trailing whitespace from arguments before it processes them further. This fixed the issue. I don't know if there are any cases where it's desirable to leave whitespace alone in arguments, but if a case turns up that is broken because of this change, please let me know.

CodeCat15:40, 18 January 2016

Thanks!

Benwing2 (talk)16:13, 18 January 2016
 

The workaround that made {{it-adj}} work for multi-word adjectives now no longer works because of this. Basically, if the template finds text in the first parameter, it adds endings to that. The problem with multi-word adjectives is that the endings don't go at the end, so they can't have a first parameter. Putting a space in the first parameter allowed it to be empty for some purposes but not for others- a complete kludge, but it worked. We need to come up with some kind of fix for this: I have a hunch the Italian-editing community would much rather remove the invocation of Module:parameters than have to use {{head}} for these adjectives if forced to choose.

Chuck Entz (talk)04:31, 19 January 2016

I think the other possibility is not to have Module:parameters strip whitespace, but to do it in Module:usex/templates so it applies only to {{ux}}. This business about leading/trailing whitespace being stripped in named but not unnamed params is a total kludge but it's the way Mediawiki works, and things like mwparserfromhell seem to know about this, so it may not be a good idea to change it.

Benwing2 (talk)04:34, 19 January 2016

I think stripping whitespace should be the default behaviour. For Italian specifically, an override could be added to Module:parameters. However, I think it would be better to look at why the template needs to work this way to begin with.

CodeCat18:15, 19 January 2016

BTW, I just looked at Wikipedia's Arguments module and it works this way -- whitespace is trimmed by default from parameters, but you can turn it off. The documentation appears to say that setting trim=false turns off whitespace trimming, and setting removeBlanks=false turns off the conversion of empty arguments to missing arguments (i.e. the implementation of ine() around arguments).

Benwing2 (talk)21:07, 20 January 2016

Our module already implements the latter (allow_empty), adding the former should be easy.

CodeCat21:09, 20 January 2016