Remove Highlighting from Search Results

Posts: 69
Joined: Thu Mar 21, 2013 12:55 am

Remove Highlighting from Search Results

Post by pault » Wed Aug 24, 2016 8:57 pm

When a user searches on a website generated from WebHelp Responsive, the search terms are highlighted in the result documents. This highlighten can be distracting. Is there a way to turn off the highlighting other than removing ?hl=term from the URL?



Site Admin
Posts: 156
Joined: Thu Dec 24, 2009 11:21 am

Re: Remove Highlighting from Search Results

Post by alin » Thu Aug 25, 2016 11:34 am


Unfortunately, there is no straight forward option that can be used to turn off the highlighting mechanism.

However, you can achieve this by editing the default template used to generate the WebHelp Responsive output:
  1. Open the JavaScript file that contains the code responsible for highlighting the search terms:
  2. Change the value for the highlighted variable at line 2 to true.

    Code: Select all

    var highlighted = true;
The fix above is valid only if you are using DITA-OT 2.x as the current DITA Open Toolkit distribution. If you are using DITA-OT 1.8 you should edit the next file:

You can check which version of DITA Open Toolkit you are using in the DITA preferences page (Main Menu -> Options -> Preferences...).
Alin Balasa
Software Developer
<oXygen/> XML Editor

Post Reply