Menu

Removing Spaces From New Pages

Help
2005-04-09
2012-10-11
  • Justin W. Williams

    I am setting up a new wiki and don't want any of my pages to have spacing. If for example, someone wants to create a page called [Mac mini], I want it to automatically remove the space and turn it into MacMini (I'd settle for a hyphen even). Is this possible?

    Your help is appreciated.

     
    • Justin W. Williams

      Purely cosmetic reasons. It would match the structure of the rest of our website.

       
    • Justin W. Williams

      Also, what files am I going to have to edit to get this functionality implemented?

       
    • Joel Uckelman

      Joel Uckelman - 2005-04-10

      It's possible, but it will take a small modification of the new page code to make it work. Probably the best way for us to handle it is to add a setting in the config file.

      And to think, we just went through all the trouble of making sure that page names with spaces work properly. :)

      BTW, why do you want that?

       
    • Joel Uckelman

      Joel Uckelman - 2005-04-11

      I think you'd need to alter WikiPageName::_check() in lib/stdlib.php, for one. You can prevent the creation of any pages whose names contain whitespace by changing the ' ' to a '', in the first line.

      One problem that leaves is that if I edit a page to contain

      [contains spaces]

      it still shows up with a '?' link, even if containsspaces already exists. So there's a second place where you want to remove whitespace, but I'm not sure yet where.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.