876
edits
No edit summary |
No edit summary |
||
Line 29: | Line 29: | ||
Some of these operations are whitespace sensitive, so we must strip away any whitespace around the string parameter. That's why the string parameter is surrounded by <code><nowiki>{{#if:x| {{{1|}}} }}</nowiki></code> in some places. | Some of these operations are whitespace sensitive, so we must strip away any whitespace around the string parameter. That's why the string parameter is surrounded by <code><nowiki>{{#if:x| {{{1|}}} }}</nowiki></code> in some places. | ||
{{ | {{str len}} first checks if the string is 500 characters or longer, since the search function in /core would otherwise return 499 for any string of 500 characters or more. (The older version of /core returned 999.) This also means that checking the really long strings is fairly efficient, it only takes one padleft operation and no parsing of the /core sub-template. | ||
The three calls to /core is actually a loop, or recursion if you will. | The three calls to /core is actually a loop, or recursion if you will. | ||
The parameters to /core are whitespace sensitive. That is why we indent the parameters to /core so strangely. See more about this in the next section. If you change any of the indentation in {{ | The parameters to /core are whitespace sensitive. That is why we indent the parameters to /core so strangely. See more about this in the next section. If you change any of the indentation in {{str len}} you are likely to break this template. We could of course add a lot of whitespace stripping in /core, but that would cause hideous code in /core and would be very inefficient. | ||
==== About ((str len/core)) ==== | ==== About ((str len/core)) ==== |
edits