<div dir="auto">thanks very much, that's brilliant<div dir="auto">Simon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 2 Apr 2024, 09:59 Petko Yotov, <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">$MakePageNamePatterns has rules calculating the page name Group.PageName <br>
from a string like "page name". It seems you need a way to "space" page <br>
names like in {PageName$Namespaced} or in {(asspaced text)}, that's the <br>
opposite.<br>
<br>
Spacing is done by the function AsSpacedUTF8($text) which converts a <br>
string with WikiWords into a spaced version of that string. It can be <br>
overridden via $AsSpacedFunction:<br>
<br>
$AsSpacedFunction = 'SimonAsSpaced';<br>
function SimonAsSpaced($text) {<br>
$text = AsSpacedUTF8($text);<br>
$text = preg_replace('/([A-Z])\\s+(\\d)/', '$1$2', $text);<br>
return $text;<br>
}<br>
<br>
Here, instead of rewriting the whole AsSpacedUTF8() function, we call <br>
it, then undo the damage it did to our text.<br>
<br>
With this, "{E1Freeway$Namespaced}" will print "E1 Freeway".<br>
<br>
Alternatively, you can copy the full AsSpacedUTF8() function to <br>
config.php under a different name, adapt it, and set the <br>
$AsSpacedFunction variable to the new name.<br>
<br>
Petko<br>
<br>
On 01/04/2024 22:23, Simon wrote:<br>
> I've had a look through the documentation and discovered<br>
> $MakePageNamePatterns,<br>
> <br>
> What I want to do is exclude certain patterns from being space<br>
> separated.<br>
> <br>
> Specifically a Capital letter followed by a digit.<br>
> <br>
> e.g. " E1 " is displayed as " E 1 "<br>
> <br>
> Is there a way to configure this?<br>
> <br>
> thanks in advance<br>
> <br>
> Simon<br>
</blockquote></div>