HelpHub
HelpHub copied to clipboard
Jump links contain superflous unicode characters
Simplify jump links by removing such characters
For example on https://wordpress.org/support/article/settings-discussion-screen/ we have these jump links:
https://wordpress.org/support/article/settings-discussion-screen/#email-me-whenever%ef%bb%bf https://wordpress.org/support/article/settings-discussion-screen/#before-a-comment-appears%ef%bb%bf https://wordpress.org/support/article/settings-discussion-screen/#comment-moderat%ef%bb%bfion%ef%bb%bf
Looks like this is a ZERO WIDTH NO-BREAK SPACE https://www.fileformat.info/info/unicode/char/feff/index.htm
Also known as BOM: https://en.wikipedia.org/wiki/Byte_order_mark
I don't think it is useful or intended here and therefore should be removed to simplify those jump links.
I haven't checked any other pages, but maybe the problem is on more helphub pages.
@Zodiac1978
These links in the TOC were automatically generated from the content by Plugin. The plugin generates the link based on the heading texts in the content. So, some lines must have those characters at the end of each line.
But, problem is those characters are invisible and no way to find it nor fix it.
For this article 'Settings Discussion Screen', I could remove those characters by re-typing heading lines and saving the document. I won't check every TOC, but 'll do the same things when I noticed those characters.
Thanks.
Hi @atachibana
I think it would be a better approach to convert these spaces to normal ones in the TOC plugin instead of doing it manually.
All the best Torsten
@Zodiac1978 Yes, it should be so.
@Kenshino Do you know who is the owner of TOC plugin? We'd like to ask to modify
- When it generates the link that includes '%ef%bb%bf' a the end of it, take it away.
I think we built it.
@carl-alberto did it.
@atachibana feel free to modify, unfortunately I don't have bandwidth mo modify at the moment :(
@carl-alberto @Kenshino If you point me to the correct location I can (hopefully) provide a patch to fix this in the plugin.
Here you go @Zodiac1978 ;) https://github.com/WordPress/HelpHub/tree/master/plugins/support-helphub/inc/table-of-contents-lite