Skip to content

Use underscores to specify whitespaces in tags #49

Open

Description

@klausbraun

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.

Activity

  1. lpaulsen93 commented on May 2, 2016

    @lpaulsen93
    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.

  2. michitux commented on May 2, 2016

    @michitux
    Member

    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.

  3. lpaulsen93 commented on May 2, 2016

    @lpaulsen93
    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?

  4. michitux commented on May 2, 2016

    @michitux
    Member

    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.

  5. lpaulsen93 commented on May 2, 2016

    @lpaulsen93
    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)?

  6. Klap-in commented on May 2, 2016

    @Klap-in
    Member

    (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)

  7. michitux commented on May 3, 2016

    @michitux
    Member

    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.

  8. klausbraun commented on May 3, 2016

    @klausbraun
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions