Page MenuHomePhabricator

substr parser function
Closed, DeclinedPublic

Description

Author: ncw33

Description:
an extra parser function

In some templates, it is useful to be able to do some basic reading of the string. For example, the cite book template needs to be able to read at least the last letter of the strings it is passed, so that it can fix output by not putting a period after a period-ended string (this does appear on several real-world wiki articles), and the 'best practices' solution is to keep the period with the citation to be semantically correct, and fix this in the formatting stages in the template.

Now, if there is a way to do this, I have not yet found it (nor have the cite book authors), so my patch may be the wrong way/place to do this, but it is a simple, harmless, generic function that can be trivially wrapped in a template to do odd little useful things like in the cite book example.


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz16332

Event Timeline

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

Already in the StringFunctions extension, see bug 16197.

ncw33 wrote:

Ah, sorry. That (for some reason) is not on Wikipedia, which is probably why I had not found it when searching for this. Thanks.