Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Rework output of the person() user function #756

Closed
BoboTiG opened this issue Apr 23, 2021 · 4 comments · Fixed by #757
Closed

[FR] Rework output of the person() user function #756

BoboTiG opened this issue Apr 23, 2021 · 4 comments · Fixed by #757
Assignees
Labels
bug Something isn't working locale:French

Comments

@BoboTiG
Copy link
Owner

BoboTiG commented Apr 23, 2021

Wikicode:

{{nom w pc|Leopold von Sacher-''Masoch''}}

Output:

user_functions.py:331: UserWarning: Malformed template in the Wikicode of 'masochiste' (parts=['Leopold von Sacher-<i>Masoch</i>'])
  warn(f"Malformed template in the Wikicode of {word!r} (parts={parts})")
Leopold von Sacher-<i>Masoch</i>

Expected: no warning


nom w pc is calling person() with only one arguent, resulting in the warning, cf

"nom w pc": "person(word, [p for p in parts[1:] if '=' not in p])",

I do not recall why the warning was put, it was introduced with f66c96e.

@BoboTiG BoboTiG added the bug Something isn't working label Apr 23, 2021
@BoboTiG BoboTiG changed the title [FR] Fix handling of the person() [FR] Fix behavior of the person() user function when there is only one argument Apr 23, 2021
@BoboTiG
Copy link
Owner Author

BoboTiG commented Apr 23, 2021

@lasconic WDYT? I guess the warning may be useful sometimes, when the last name is not set.

I just saw (here](https://fr.wiktionary.org/wiki/Mod%C3%A8le:nom_w_pc) that the template is deprecated:

ATTENTION : il est désormais recommandé d’utiliser des caractères ordinaires pour le nom de famille des auteurs (décision collective de mars 2021). L’usage de ce modèle est en conséquence à éviter. Il a été modifié pour ne plus afficher de petites capitales.

@BoboTiG
Copy link
Owner Author

BoboTiG commented Apr 23, 2021

I'll fix the template handling, will let the PR opened for review :)

@lasconic
Copy link
Collaborator

I never liked the small cap for last names :) and I guess the warning is obsolete?

@BoboTiG
Copy link
Owner Author

BoboTiG commented Apr 23, 2021

Yup :)

@BoboTiG BoboTiG changed the title [FR] Fix behavior of the person() user function when there is only one argument [FR] Rework output of the person() user function Apr 23, 2021
@BoboTiG BoboTiG self-assigned this Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working locale:French
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants