Page MenuHomePhabricator

Check for line breaks in user signatures
Closed, ResolvedPublic

Description

Apparently, it is possible to have a line break in one's signature. This should display a warning on the preferences page or be disallowed (similar to https://www.mediawiki.org/wiki/New_requirements_for_user_signatures).

Line breaks in signatures are problematic because:

  • Usually they will cause the markup to break when the signature is used in a nested comment (in a list item)
  • When the line break is inside a link label, it does not break the markup, but it can cause dirty diffs in Parsoid (T265094) and can be confusing to people reading the wikitext and trying to reply

While you can't type them in the Special:Preferences interface, because it has a single-line text field, you can such a signature via an API or by using a substituted template in your signature.

Event Timeline

Filing this following the discussion in T265094.

@ppelberg @Whatamidoing-WMF Do you think this is something we could easily add to the signature requirements? (It's easy to implement.)

Here's a few examples, caught by dtcheck.toolforge.org:

FWIW, Parsoid can now handle line breaks for the enwiki and simplewiki cases, but doesn't yet have handling for the arwiki signature because it the link with the line break is nested in <sup>..</sup>. While we could add handling for generalized nesting (since it is technically not an error), it just adds extra code complexity with diminishing returns. Some future code cleanup / refactor might bring in support for this more naturally, but that is not happening any time soon.

Change 656973 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/core@master] Check for line breaks in user signatures

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

This seems sensible and uncontroversial:

  • they cause problems
  • they add no real value
  • they are extremely rare
  • it is already implied that you aren’t supposed to use them because the signature input is single line

Filing this following the discussion in T265094.

@ppelberg @Whatamidoing-WMF Do you think this is something we could easily add to the signature requirements? (It's easy to implement.)

Here's a few examples, caught by dtcheck.toolforge.org:

As we discussed during the team's 20-Jan meeting, before we can move forward with implementing the line break signature requirement, we'll need to consult with volunteers to learn in what – if any – cases this requirement could be problematic.

This consultation will happen in T272667.

A few other notes from that meeting are here:

  • Mass message does break signatures into separate lines: "line 1" contains the sender's username and "line 2" contains the time at which the mass message was sent. However, this does NOT seem to conflict with the new requirement @matmarex is proposing above considering this requirement is limited to cases where people are signing with ~~~~ [i].

i. Note: Mass message "senders" manually type out the contents of "line 1" and type ~~~~~ to produce the timestamp in "line 2".

Change 656973 merged by jenkins-bot:

[mediawiki/core@master] Check for line breaks in user signatures

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

ppelberg claimed this task.
ppelberg added a project: Skipped QA.

Resolving this. @matmarex is going to alert people on mediawiki.org that this will be live at all projects this Thursday, 29-April: https://www.mediawiki.org/wiki/Topic:W4sx12qy3xt2kshe.