isaacs / github

Just a place to track issues and feature requests that I have for github
2.21k stars 129 forks source link

Wiki pages with colon in the title do not clone properly #719

Open snapptop opened 8 years ago

snapptop commented 8 years ago

This wiki was created 4 years ago so that might be the problem or possibly there is some malformed content within the pages.

See screenshots of wiki pages sidebar and cloned result

demo_wiki_pages_sidebar

demo_wiki_pages_cloned

cirosantilli commented 8 years ago

Can you create a minimal example? Or it only happens for an old input which is now rejected?

snapptop commented 8 years ago

Sure. It's not really a major bug but it appears that colons are not being matched in some regex that is converting special characters to a dash (-) for file names.

1) I added a Wiki Page to this repo with the title "Testing: Colon" 2) git clone https://github.com/isaacs/github.wiki.git 3) ls

In the screenshots you will see anything after a colon is being left off of the file name. If there are multiple wiki pages with colons then subsequent wiki pages are not cloned at all.

wiki_test wiki_folder

snapptop commented 8 years ago

FYI .. got fast response from support@github.com (probably automated :p)

Hi git support -

I found a tiny bug when cloning a Wiki and thought I'd share. 

If Wiki Page Titles contain a colon ":", the file name gets screwed up and subsequent Wiki Pages with colons do not get cloned at all.

Issue with screenshots
https://github.com/isaacs/github/issues/719

Wiki example
https://github.com/isaacs/github/wiki (Testing: Colon)
Petros (GitHub Staff)   
Jul 16
Hi snapptop!
Thanks for your feedback! I have shared it with our team for them to consider!
Cheers,
Petros
cirosantilli commented 8 years ago

Yup, good and old canned answers :-)

clionaderoiste commented 7 years ago

:+1:

oresmus commented 7 years ago

Related issue, perhaps with same underlying cause: the syntax for a link from one wiki page to another, namely [link text](page name), does not work (either in rendering or click effect) if the page name contains a colon (':'), even though the UI element for generating a link (a dialog put up by a button in the edit toolbar for the wiki page containing the link) generates this syntax in that case.

For example, I had a link like [topic](topic) which worked fine, but when I revised it to [topic](use case: topic) (and made a corresponding new wiki page) it stopped looking or acting like a link.

oresmus commented 7 years ago

I found a workaround for the link syntax bug I just mentioned -- percent-escape the colon. That is, a link like this works properly: [topic](use case%3A topic)

(Unfortunately I don't see any way this can help with the wiki-page-cloning bug this issue is actually about. The actual page name still contains a colon, and the original bug here is not about the link syntax.)

kruncher commented 7 years ago

It would be awesome if you could specify a custom slug for the url for situations where it would produce undesirable filenames.

Like it could show a warning below the title field "This title contains characters that are not compatible with Windows filenames. It's a good idea to specify a slug." This would avoid breaking backwards compatibility with existing topics but would encourage authors to avoid the issue when creating new topics.