roadkill icon indicating copy to clipboard operation
roadkill copied to clipboard

Inner page linking issue

Open jaakkop opened this issue 8 years ago • 6 comments

I'm unable to create a link to a page with a minus/dash sign in title.

For example a page with title "Test-page": Link to a test page

The generated link insists on creating a new page instead of linking to the existing page.

I'm using Markdown styling.

jaakkop avatar Mar 07 '16 13:03 jaakkop

Further observations about page linking:

  • Markdown doesn't allow spaces in titles
    • eg. [Link 1](Link with spaces) -> doesn't generate a link
      • [Link 1]("Link with spaces") -> generates empty link ""
  • Underscores are escaped but don't match with existing pages
    • eg. [Link 2](Link_with_underscores) -> generates link "Link%1ae372029427ewith%1ae372029427eunderscores" but doesn't match with the actual page title

jaakkop avatar Mar 07 '16 14:03 jaakkop

You need to use dashes for spaces in page names with Markdown

yetanotherchris avatar Mar 09 '16 08:03 yetanotherchris

Minuses are reserved for spaces right now, a workaround for the markdown parser. Can you use a dash instead?

On Mon, 7 Mar 2016, 14:45 jaakkop, [email protected] wrote:

Further observations about page linking:

  • Markdown doesn't allow spaces in titles
  • Underscores are escaped but don't match with existing pages

— Reply to this email directly or view it on GitHub https://github.com/roadkillwiki/roadkill/issues/45#issuecomment-193278065 .

yetanotherchris avatar Mar 09 '16 09:03 yetanotherchris

I'm hitting the same problem, as we often want to use a hyphen (minus) in the page title, but I think that this also highlights a bigger problem with the handling of titles.

If you update the title of a page, all historic versions of the page inherit the new title. This means that you can't actually tell what the old title of the page was from the history, which seems wrong to me.

Could the linking to a page use the page ID, rather than the title? It might also be nice to have an editor toolbar button that lets you pick the page that you want to link to.

J0nKn1ght avatar May 05 '16 12:05 J0nKn1ght

I just ran into this today and thought the product was completely busted right out of the box. I tried to link to "A-B-C" but also naming the page "A-B-C" and it would refuse to notice the page at all, insisting on creating a new page. Changing the page name to "A B C" made it work. Having autocompete for page names or a way to insert page links would fix this. In the meantime it is incredibly confusing and documenting it would not be a bad idea.

JesperTreetop avatar Jan 31 '17 13:01 JesperTreetop

Hi,

When I used a relative path it generates a link like "create a new page". Only when I used a full url that starts with http it generates correct link.

This generates incorrect link like "/pages/new?title=%2fpages%2fallpages" and it navigates to creation page. [[/pages/allpages|Click here to see all pages.]]

This generates correct link. [[http://www.github.com/pages/allpages|Click here to see all pages.]]

I want to use only relative paths in page contents. How do I resolve this issue?

kamilozturk avatar Jul 31 '19 09:07 kamilozturk