Help Centre search snippets return JavaScript code present in the article | Community
Skip to main content

Help Centre search snippets return JavaScript code present in the article

  • August 9, 2021
  • 2 replies
  • 0 views

Our Help Centre articles have JavaScript in them to enable the article to be displayed in a printer friendly format. It works really well but when the Help Centre is searched the snippet extract form the article is sometimes taken from the JavaScript code. For example searching for "4.2" returns the snippet extract

'; // now rewrite the body of the page document.getElementsByTagName('body')[0].outerHTML = body; } function back

What's the best way to hide JavScript from Zendesk search results and being displayed in snippets?

 

2 replies

Dave12
  • August 10, 2021

Hi Graham, this is unexpected behavior, so I'm going to bring this post into a ticket so our team can troubleshoot. Thanks for the heads-up!


  • Author
  • August 11, 2021

Thank you Dave. You can see the behaviour at https://u3abeacon.zendesk.com 

Type 4.2 into the search box.