Page MenuHomePhabricator

Trim Whitespace around Label/Description/Aliases and Schema text
Closed, ResolvedPublic5 Estimated Story Points

Description

Problem:
Whitespace at the beginning and end of labels, descriptions, aliases and the Schema text are unnecessary. We already remove it for labels/descriptions/aliases on Items and Properties and a number of fields on Lexemes. The whitespace at the very beginning and end of a label, description, each of the aliases and the Schema text should be trimmed when saving.

BDD
GIVEN a Schema
WHEN entering a label, description, alias or Schema text with a whitespace at the beginning or end
AND then saving the input
THEN the whitespace is discarded before storing

Acceptance criteria:

  • any number of spaces at the beginning or end of the label, description, aliases or Schema text of a Schema is discarded before saving
  • any whitespace in places other than the beginning or end is kept as-is

Event Timeline

Lucas_Werkmeister_WMDE renamed this task from Trim Whitespace around Label/Description/Aliases and Schema to Trim Whitespace around Label/Description/Aliases and Schema text.Mar 7 2019, 2:01 PM
Lucas_Werkmeister_WMDE updated the task description. (Show Details)
Lucas_Werkmeister_WMDE set the point value for this task to 5.EditedMar 7 2019, 2:06 PM

Note: in Wikibase, this happens via the StringNormalizer class.

We’ll probably implement this in the SchemaEncoder, and also change the current alias deduplication to take place there (instead of deduplicating in the edit special page and only checking for duplicates in the encoder, which currently has the effect that Special:NewSchema still throws on duplicate aliases).

Change 498160 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Trim leading and trailing whitespace

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

Change 498160 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Trim leading and trailing whitespace

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