Last modified: 2010-07-08 20:29:01 UTC
Created attachment 7532 [details] Diff between r68758 and my changes. When you have a template that just sets some configuration or inserts a div, for example, it is often nice to leave lots of whitespace in the wiki code for readability. However, this will often affect the layout of the calling page. Two new parser functions have been proposed to help deal with this issue (although there could be many different ways to deal with it). <!-- Trim the whitespace from before and after the text returned by 'template' --> {{#trim: {{template}} }} <!-- Remove *all* the whitespace from within the text returned by 'template' --> {{#nospaces: {{template}} }} Attached is a diff that adds these two parser functions to the cleverly named ParserFunctions extension.
Here is a 'working' version (see the tests): http://bifx.org/~dmb/phase3/index.php/Main_Page
Fixed in r69197 (trunk) by creating a new parserfunction #stripnewlines as part of http://www.mediawiki.org/wiki/Extension:StringFunctionsEscaped. Additional whitespace remove function deemed unnecessary by submitter.