Page MenuHomePhabricator

Implement a {{#trim}}, {{#ltrim}}, {{#rtrim}} in StringFunctions
Open, LowPublic

Description

Sometimes it would be great if there would be a {{trim}} (core) function, since the unnamed parameters are not trimmed by default.
I'd propose {{trim}}, {{ltrim}} and {{rtrim}} to be included in the core functions.
They should have an optional second parameter like their PHP equivalents.

Details

Reference
bz18157

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:30 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz18157.
bzimport added a subscriber: Unknown Object (MLST).

It would be nice to add this parser function to the [http://www.mediawiki.org/wiki/Extension:ParserFunctions ParserFunctions-Extension]. I’ll try to do this.

Moving this to Extensions. This won't go in core, but StringFunctions--or ParserFunctions, once it's all finally merged and the former is obsolete--should probably implement this.

Dinoguy1000 renamed this task from Implement a {{#trim}}, {{#ltrim}}, {{#trim}} in StringFunctions to Implement a {{#trim}}, {{#ltrim}}, {{#rtrim}} in StringFunctions.Apr 7 2020, 5:44 AM
Dinoguy1000 updated the task description. (Show Details)