-
Couldn't load subscription status.
- Fork 81
Remove ¶ while displaying search results #1590
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
Conversation
The permalink character `¶` is extracted and indexed by the crawler. To ensure that it always removed when displaying search results, it can be done with `docsearch` `transformData` https://docsearch.algolia.com/docs/legacy/behavior/#transformdata
docs/js/custom.js
Outdated
| $.each(hits, function(index, hit) { | ||
| for (lvl=2; lvl<=3; lvl++) { | ||
| if (null !== hit.hierarchy['lvl'+lvl]) { | ||
| hits[index].hierarchy['lvl' + lvl] = hit.hierarchy['lvl' + lvl].replace(/[.¶]/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find where this is used. _highlightResult.hierarchy is the one used to build the dropdown result menu.
|
Some examples to test:
|
(cherry picked from commit 23f5bf2)
(cherry picked from commit 23f5bf2)
(cherry picked from commit 23f5bf2)
(cherry picked from commit 23f5bf2)
|
Cherry-picked to 4.1, 4.0, 3.3, 2.5 |
The permalink character
¶is extracted and indexed by the crawler.Actually, it is shown in search results on https://doc.ibexa.co/en/4.1/ while not shown on https://doc.ibexa.co/en/3.3/ which is still an enigma to me while opening this PR.
To ensure that it's always removed when displaying search results, it can be done while building the dropdown using DocSearch v2's
transformDatafeature.