Anomie added a comment.
In T218127#5032746 <https://phabricator.wikimedia.org/T218127#5032746>, @Lucas_Werkmeister_WMDE wrote: > Well, `Message` doesn’t have to be the only way to do i18n. We can add some hook that lets us completely bypass the `Message` and `comment_text`, and instead directly return HTML based on the `comment_data`, That'd be what I'd recommend if something really wants to do something beyond what standard comment formatting can handle. To what extent we want to make that generically possible versus encouraging developers not to get too fancy about comment formatting is an open question. > By the way, I noticed that this is not the first time that `Message`’s output formats aren’t quite adequate – API errors and warnings have a situation that feels similar to me. Non-legacy errors support several error formats, including `wikitext` (i. e. `$msg->text()`) and `html` (`$msg->parse()`), but also `plaintext`, “intended for human display in HTML-incapable clients.” And to generate this plaintext, which doesn’t directly match any `Message` output format, the `ApiErrorFormatter` takes the `->text()` of the message and then strips a bit of markup with a custom function, in “a minimal, best-effort transformation to make the message … more readable”. We could apply a similar transformation to a message to get its `comment_text` (except in this case the target format isn’t quite plain text), while fully parsing the message in places where HTML is expected. I suppose that depends on how much difference there is between API error messages and what you're wanting to do with comments. In the API errors and warnings the only HTMLish markup normally used is `<var>`, `<kbd>`, `<samp>`, and `<code>`, and the semantic meaning of those tags in unformatted text is basically preserved by converting them into quotation marks. TASK DETAIL https://phabricator.wikimedia.org/T218127 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Anomie Cc: WMDE-leszek, hoo, Aklapper, Lucas_Werkmeister_WMDE, Anomie, daniel, pdehaye, alaa_wmde, Michael, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, YULdigitalpreservation, LawExplorer, Salgo60, _jensen, rosalieper, MGChecker, abian, Wikidata-bugs, aude, Dinoguy1000, Lydia_Pintscher, Mbch331
_______________________________________________ Wikidata-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs
