xif-fr / dokuwiki-plugin-catlist

DokuWiki plugin to list pages and namespaces recursively in nested lists
https://www.dokuwiki.org/plugin:catlist
8 stars 15 forks source link

Add page button not working for namespaces #20

Closed dantim closed 5 years ago

dantim commented 5 years ago

Hi, current version of catlist does not support namespaces anymore. Before, you could add either a normal page (like 'newpage') or a namespace (like 'newns:').

If you try to add 'newns:' now, it will just add a new page and not a new namespace.

xif-fr commented 5 years ago

Has it ever worked this way ? I don't recall… Is it since the version of last week ? Thanks

dantim commented 5 years ago

It used to work in ancient versions; I think the behaviour changed since the line 39 was added to script.js:

pagename = pagename.replace(/[^a-zA-Z0-9._-]+/g, catlist_sepchar) // transforms characters ...

That causes the trailing colon of the namespace to be changed into an underscore, which in turn is removed by the following line.

If I add a ‘:’ into the regexp the old behaviour is restored. I don’t know if the capability to handle namespaces has ever been intentional or not, but it is compliant with Dokuwiki rules.

xif-fr commented 5 years ago

You're right, fixed it. Thanks !