MewBot is introducing errors

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

I don't know if that's even the template's doing.

CodeCat02:48, 18 January 2016

I think that could easily be fixed by stripping newlines from the ends of the example and transliteration.

DTLHS (talk)02:53, 18 January 2016

I agree with DTLHS that you should strip whitespace from the ends of the example (param 2). In this case it worked before because whitespace is stripped from named parameters and not from unnamed parameters, and the example was specified as 1=..., i.e. as a named parameter. If you change the new {{ux}} so that the example in parameter 2 begins with 2=, everything works. But that's a horrible hack.

Benwing2 (talk)07:35, 18 January 2016

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