Page MenuHomePhabricator

StatusFormatter does not support messages that contain wikitext lists
Closed, ResolvedPublic

Description

If I have

"my-message-1": "No list here"
"my-message-2": "List here:\n* Item 1\n* Item 2"

and I do:

$status = Status::newFatal( 'my-message-1' )->fatal( 'my-message-2' );
echo $status->getHTML();

StatusFormatter will put the two errors in a bullet list, but since that uses wikitext, the inner list in the second message will also be merged with the outer list, as shown in this screenshot:

image.png (234×244 px, 9 KB)

There's no way for callers to work around this, and StatusFormatter should probably use HTML for the list instead.

Event Timeline

Change #1050710 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] status: Use HTML lists in StatusFormatter::getWikiText

https://gerrit.wikimedia.org/r/1050710

This came up in the past in the context of on-wiki message overrides adding not just lists, but also tables and stuff.

Duh. I can't help but look at who filed/resolved those tasks and be like "well of course I know him, it's me". I knew there was at least I task I had worked on in the past, but my phab search yielded T173249 only, and I thought I was making it up. Anyway. Since it's the third time I find myself hating this behaviour, I guess it's time for a change.

Change #1050710 merged by jenkins-bot:

[mediawiki/core@master] status: Use HTML lists in StatusFormatter::getWikiText

https://gerrit.wikimedia.org/r/1050710

Resolving this, and eagerly awaiting to learn how I managed to screw something up in some new fun way.