Wiki page creation

This is not a critical issue, more a quality-of-life bug.

Create a new page: Test Page
Page gets named: Test_Page
Link to [[[Test Page]]] becomes: Test-Page

I’ve found that creating pages named Test-Page, which creates the page correction, then going back and editing it so the visible name is Test Page.

1 Like

Yeah that’s a bug. The auto-naming and auto-linking of wiki pages with spaces in their names should match! Will fix in the next patch, thanks.

ETA: Actually scratch the tempfix I posted initially. This one might be a little trickier.

OK if you want to patch it yourself before the next patch is released, try this fix:

In aresmush/plugins/website/wiki_markdown/wikidot_compatibility.rb, fix the if/else in WikidotInternalLinkMarkdownExtension so it uses sanitize_page_name instead of the old gsub.

Old:

        url = url.downcase.gsub(' ', '-')
        if (url.start_with?("char:"))
          "<a href=\"/char/#{url.after(':')}\">#{link}</a>"
        else
          "<a href=\"/wiki/#{url}\">#{link}</a>"
        end

New:

       if (url.start_with?("char:"))
          "<a href=\"/char/#{url.after(':')}\">#{link}</a>"
        else
          url = WikiPage.sanitize_page_name(url)
          "<a href=\"/wiki/#{url}\">#{link}</a>"
        end
1 Like

Thank you! Working fine.

Similar issue - link text put into a page as

[[[creatures#creating-creatures|creatures]]]

renders the URL as

creatures_creating-creatures

so the link fails.

Ooops. Yeah, that’s a bug. Thanks.

Good news and bad news… In the next patch, this will be fixed so it at least goes to the ‘creatures’ page as you intended rather than trying to create a new creatures-creating-creatures page.

But the bad news … the wiki doesn’t support jumping to an anchor from another page. This appears to be a problem in the javascript framework I’m using (Ember). There are workarounds in Ember itself, but since the wiki is kind of being generated through backdoor markdown outside of Ember, I don’t see any way to make that work. Best you can do is to have a table-of-contents sort of thing at the top of the page to jump to the various sections.