apps-android-commons
apps-android-commons copied to clipboard
Author field shows HTML tags when template used
Summary
When viewing my recent uploads in the app (using Beta version=4.0.3~23c474b06), the attribution includes visible HTML markup and incorrect text. This is apparently caused when {{Creator:Andy Mabbett}} is present on the Commons file page, as it includes the description from the associated Wikidata item. For items with the author in plain text, the issue does not occur.
Steps to reproduce
As above
Expected behaviour
Correct attribution should be shown.
Actual behaviour
As above
Device name
No response
Android version
Android 11
Commons app version
4.0.3~23c474b06
Device logs
No response
Screen-shots
https://commons.wikimedia.org/wiki/File:Commons_app_beta_screenshot_showing_attrbution_text_errors_-_2022-08-07.jpg
Would you like to work on the issue?
Prefer not
What would be the correct attribution to show in this case? Should the app try to convert the content of {{Creator:Andy Mabbett}} to (short) plain text somehow?
I tested it and it happened with https://commons.wikimedia.org/wiki/File:Zhu-Zhanji-Gibbons-at-Play.jpg . In this case, the creator is not me. (I uploaded a public domain artwork.)

What would be the correct attribution to show in this case? Should the app try to convert the content of {{Creator:Andy Mabbett}} to (short) plain text somehow?
I think that the template's whole text would be too much text. The simplest solution may be to render the name of the individual template without the "Creator:" prefix; so in the first case above, "Andy Mabbett", and for the second (your) example, "Xuande".
Alternatives for your example would be to use the top line's link text ("Xuande Emperor") or the entire top line's text ("Xuande Emperor (1399–1435)")