Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use underscores to specify whitespaces in tags #49

Open
klausbraun opened this issue May 2, 2016 · 8 comments
Open

Use underscores to specify whitespaces in tags #49

klausbraun opened this issue May 2, 2016 · 8 comments

Comments

@klausbraun
Copy link

The FAQ for the cloud plugin says one should use underscores to specify whitespaces in tags, but this doesn't work: Tags with underscores are shown with underscores and not with whitespaces.

@lpaulsen93
Copy link
Member

The FAQ of the tag plugin says that quotes can be used for this purpose e.g. {{tag>"Tag with whitespace"}} but this produces the same result, no whitespace just underscores.

@michitux
Copy link
Member

michitux commented May 2, 2016

Iirc, tags are normalized like regular DokuWiki page names, which means that tags cannot contain whitespaces. As in regular DokuWiki page names, whitespace is therefore replaced by an underscore.

@lpaulsen93
Copy link
Member

Well, I had a look in the tag plugin code and it seems right at the start whitespace is replaced with underscores. Strange thing is that it's written on both plugin (tag and cloud) pages that it would work.

Shall we change the plugin pages? Do you see a chance to implement it?

@michitux
Copy link
Member

michitux commented May 2, 2016

Each tag corresponds to a wiki page id. Tags without namespace correspond to a page in the tag namespace, tags with a namespace correspond to a page in that namespace. Whenever that page exists, the tag links to that page instead of the automatically generated page list. Therefore I think it makes sense to apply the same rules to tags as we apply to page ids.

@lpaulsen93
Copy link
Member

I agree to that. But on the other hand the tag on the page is displayed in it's original way. If you look at #34 there is kind of the same problem. The tag does not look/is not displayed as expected. It kind of irritates if on the page where the tag is defined it is displayed as is and on the cloud it's not.

Would it be possible to basically keep the tag as is but additionally store a display version of the tag for output (with the tag in it's original version)?

@Klap-in
Copy link
Member

Klap-in commented May 2, 2016

(side note:
In the old bug tracker there was an issue that proposes a manner of beautification by always showing _ as spaces. It is fine that people input spaces, because in practice all input always goes through cleanID(). See for example https://bugs.dokuwiki.org/index.php?do=details&task_id=2342
It is that this requires a whole new renderer (for just overriding _simpleTitle() ), otherwise I had offered this beautification as plugin)

@michitux
Copy link
Member

michitux commented May 3, 2016

The problem with storing the original version is that there could be more than one version. When you click on a tag on a page, the original tag is passed as a parameter to the tag's page in order to avoid that problem. When you store just any version the user entered, he might be even more confused, especially if that version comes from a page he cannot read because of ACL rules. I agree though that some beautification would be nice - unless the user explicitly wants underscores. Maybe we could add some configuration option? Maybe even for storing the original string? I think if it is explicitly configurable it is okay and probably a great feature for most users. There was also a similar issue in the tag plugin related to the deaccent option in DokuWiki, see dokufreaks/plugin-tag#67 and dokufreaks/plugin-tag#16.

@klausbraun
Copy link
Author

As far as I can see tags displayed on dokuwiki pages with the help of the tag plugin don't show
underscores. Instead they are replaced by white space, which obviously is done in the helper.php
script of the tag plugin in line 131 (str_replace('_',' ', noNS($tag))). For me it would be more
stringent and would even look much better, if underscores in the cloud representation of the tags
would also be replaced by white spaces. To be able to configure this would at least be the best
solution I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants