Slash in Index keyword?

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
Tony Starbuck
Posts: 10
Joined: Thu Feb 21, 2019 6:17 pm

Slash in Index keyword?

Unread post by Tony Starbuck » Tue May 19, 2020 7:29 am

In a techdoc I thought it would be helpful to index Linux and Windows paths like this:

Code: Select all

/etc
     /foo
%programdata%
     \CompanyName
But after a build to HTML the links in the index return an Error dialog.

1) Is there a way to use slashes like this?
2) Is there a general way to escape reserved characters?
3) Is there a list of reserved characters that won't work as keywords?

Thanks!

User avatar
Tim Green
Site Admin
Posts: 21610
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Slash in Index keyword?

Unread post by Tim Green » Tue May 19, 2020 11:21 am

Hi Tony,

I just checked this and the problem you're experiencing only occurs in Premium Pack skins, so I'm guessing that is what you're using here. It's not a problem that's come up yet and needs to be fixed. A fix will be included in the next maintenance update.

As far as I can see in my tests, this problem only occurs with forward slashes. Both backslashes and the % character should be OK. Is that also your experience?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

Tony Starbuck
Posts: 10
Joined: Thu Feb 21, 2019 6:17 pm

Re: Slash in Index keyword?

Unread post by Tony Starbuck » Tue May 19, 2020 3:14 pm

Thank you for looking into this! Yes, the issue is only with forward slashes. I will do something with the text to remove the slash, and appreciate a skin change whenever it happens.
Regards

User avatar
Tim Green
Site Admin
Posts: 21610
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Slash in Index keyword?

Unread post by Tim Green » Tue May 19, 2020 3:41 pm

Tony Starbuck wrote:
Tue May 19, 2020 3:14 pm
Thank you for looking into this! Yes, the issue is only with forward slashes. I will do something with the text to remove the slash, and appreciate a skin change whenever it happens.
This is happening because the keyword needs to be included in the URL like this:

Code: Select all

/new-topic2.html?q=/this/that/another
That is impossible, because the browser will always interpret the slash character as a path and will try to evaluate everything up to the slash as part of the path, thus the topic not being found. What can be done is to URI-encode it, then the URL including an index keyword with slashes in it will look like this:

Code: Select all

/new-topic2.html?q=%2Fthis%2Fthat%2Fanother
That can't be decoded to display human-readable in the URL because as soon as you have a slash the problem arises again, since the URL is always active. What I can do, however, is to decode it before passing it to Google Analytics, if you are using that. Then, for example, you would get the more human-readable first example as the event label in your GA console. I just tested this and GA seems not to gag on it, but I'm not entirely sure about it at the moment.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

Tony Starbuck
Posts: 10
Joined: Thu Feb 21, 2019 6:17 pm

Re: Slash in Index keyword?

Unread post by Tony Starbuck » Tue May 19, 2020 4:18 pm

Thanks again for the follow-up. I'll try the URI encoding. I didn't think that would work (didn't go deep on the analysis) because %programdata% does appear in the index. If URI encoding is the answer, then for anyone else who stumbles on this thread, other reserved characters may need the same treatment:

Code: Select all

! * ' ( ) ; : @ & = + $ , / ? % # [ ]
I'll look into HTML escaping as well with

Code: Select all

/
Frankly there aren't many of these Linux path references and it's not critical to include them. It was only a convenience for the reader. I could replace it with something like this:

Code: Select all

file paths - Linux
    etc
    var
    opt
file paths - Windows
    program files
    %programdata%
So I'll spend some time on this now and will report back, but will be content to not do this or to enjoy it as a new feature if it's ever added.

Sincere thanks and regards

User avatar
Tim Green
Site Admin
Posts: 21610
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Slash in Index keyword?

Unread post by Tim Green » Tue May 19, 2020 4:28 pm

Hi Tony,
I'll try the URI encoding.
It's not such a good idea to include it in your keywords directly. It makes them illegible in the keyword index and it will also fail when the update comes that handles it automatically for the URL query fragment only, because your URI encoding will get re-encoded and then you'll have a mess. What the update would do would be to only encode for putting in the URL and leave it human-readable everywhere else, and also decode it when passing it on to the GA tracking when that is activated.
Frankly there aren't many of these Linux path references and it's not critical to include them. It was only a convenience for the reader. I could replace it with something like this:
That would really be preferable, but I'm going to include the encoding of the keywords anyway to preclude errors in the future. :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.

Post Reply