In GitHub wiki, is there any easy way to link to a page which has a dash in the title?
I'm adding reference pages to the GitHub wiki for a PowerShell module I wrote. The function names in the module follow PowerShell naming conventions so all have dashes (hyphens) in their names, similar to Set-LogConfiguration.
I want to create a man page in the GitHub wiki for each function. I can create pages with titles like "Set-LogConfiguration" without problem. However, I cannot create internal links to these pages.
I've tried the following:
[[Set-LogConfiguration]]
[[Set\-LogConfiguration]]
[[Set LogConfiguration]]
[[Set%2DLogConfiguration]]
None of these work. In each case GitHub wiki indicates the page being linked to doesn't exist.
When I save a page with a link like
[[Set-LogConfiguration]]
and then follow the link, it brings up the "Create new page" screen, to create a page Set LogConfiguration (notice the space, rather than a dash, between "Set" and "LogConfiguration"). The URL will be
https://github.com/<my repo>/wiki/Set-LogConfiguration
If I create the page directly, with title "Set-LogConfiguration", it appears to create a page with the same URL as the one created from the link, but they are two different pages.
After much experimenting, I've figured out how to link to a page with a dash (hyphen) in the title:
[[Set-LogConfiguration]]would create a page with a URLhttps://github.com/<my repo>/wiki/Set-LogConfigurationbut the page title would beSet LogConfiguration, without the dash.For example, if the URL is
https://github.com/<my repo>/wiki/Set‐LogConfiguration, copy theSet‐LogConfigurationportion of the URL.It appears GitHub wiki replaces the dash in the page title with the hex values
E2 80 90in the URL, although these will render as a dash in the browser address bar (sneaky!). Copying the page title out of the address bar will pick up the hex characters.[[page_title_copied_from_the_URL]].In the example above, the link will be
[[Set‐LogConfiguration]].Do NOT type the page title in by hand. Paste the page title copied from the URL. In your browser the text you paste will appear to be normal text, including the dash in the page title. However, in reality it will include those three hex values.
The above process doesn't take too long and will give you a page that has a dash in the title and a link to that page that works.
The only problem is that anyone subsequently editing the page with the link on it won't realise the link contains special characters, since it looks like a normal dash (hyphen). It would easy for someone to break the link by editing it, replacing the special characters that look like a dash with a real dash.