[pmwiki-users] Apostrophes

Petko Yotov 5ko at 5ko.fr
Fri May 24 11:56:15 PDT 2019


You can define custom $MakePageNamePatterns rules near the top of 
config.php, for example:

   $MakePageNamePatterns = array(
     "/'|’|‘/" => '',               # strip various apostrophes
     "/[^$PageNameChars]+/" => ' ', # convert everything else to space
     '/((^|[^-\\w])\\w)/' => 'cb_toupper', # capitalize words
     '/ /' => ''); # remove spaces

This is for your particular wiki which is in the encoding Latin1 / 
Windows1252. For international wikis that have UTF-8 enabled it will be 
slightly different, based on the UTF-8 variant of $MakePageNamePatterns.

Please note that if you have already functional links with curly 
apostrophe [[I’m Home]] to existing pages "IMHome", after the change the 
existing links will point to different pages, and while the old pages 
will still be on the wiki, they may become orphan (without an incoming 
link).

Also note that in your text editor you need to save config.php file in 
the same encoding as your wiki, that is Latin1 / Windows1252 / 
ISO-8859-1 (those are similar) and not the UTF-8 encoding. The encoding 
or "charset" can sometimes be selected in the "Save As..." dialog box. 
See
   https://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#encoding

Petko

-- 
If you upgrade :  http://www.pmwiki.org/Upgrades


On 24/05/2019 20:05, David Bruce Murray wrote:
> I'm having an issue with links that include apostrophes.
> 
> If I type [[I'm Home]], pmwiki removes both the apostrophe and the
> space to create the link I'd expect: ImHome
> 
> If the link uses a curved apostrophe, pmwiki still removes both the
> apostrophe and the space, but this time it changes the "m" to a
> capital letter M in the link: IMHome
> 
> How can I force pmwiki to create ImHome regardless of the type of
> apostrophe that was in the original link?



More information about the pmwiki-users mailing list