<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>Javascript error with UTF-8 (Arabic) search

[ad_1]

Replies: 1

The on-page search works perfectly on English pages on the sites I manage; however, on Arabic pages it fails with the following console error:

codepeople_shearch_in_place.min.js?ver=1.1.4:25 Uncaught DOMException: Failed to execute 'splitText' on 'Text': The offset 169 is larger than the Text node's length.

Generally speaking, it gives this error for words greater than 2 characters with varying offset values. Longer words will work if they only appear once on the page. For example:

  • This works: ما هو (two words of 2 characters)
  • But this does not: على (3 letters)
  • However, this does: الخروج (appears once)

Example pages:

https://hcp.adhd.org.sa/ar/البيان-الدولي-الصادر-بالإجماع-عن-الات/

https://cpg.adhd.org.sa/ar/التوصيات/

Thanks!

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer