You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Hebrew text on my page, after debugging this line (ln 36 in classes/TwigReadingTimeFilters.php) $words = str_word_count(strip_tags($content));
I found out that when I remove the strip_tags method it will give differnt (much more realistic) word count
so for one of the pages I tested it on I had:
12 - with strip_tags()
126 - without strip_tags()
I don't know if there is something wrong with my site language setup or something,
but maybe you can check the plugin...
if you need, here is a Hebrew Lorem Ispum text
btw, here is the Hebrew translation strings:
he:
PLUGIN_READINGTIME:
SECOND: שניה
SECONDS: שניות
MINUTE: דקה
MINUTES: דקות
The text was updated successfully, but these errors were encountered:
Doesn't work for Russian either. It shows 347 word page as 0 minutes 3 seconds.
I'm not familiar with php but I was able to find a workaround.
I replaced: $words = str_word_count(strip_tags($content));
with: $words = count(preg_split('/\s+/', strip_tags($content)));
I have Hebrew text on my page, after debugging this line (ln 36 in classes/TwigReadingTimeFilters.php)
$words = str_word_count(strip_tags($content));
I found out that when I remove the strip_tags method it will give differnt (much more realistic) word count
so for one of the pages I tested it on I had:
12 - with strip_tags()
126 - without strip_tags()
I don't know if there is something wrong with my site language setup or something,
but maybe you can check the plugin...
if you need, here is a Hebrew Lorem Ispum text
btw, here is the Hebrew translation strings:
The text was updated successfully, but these errors were encountered: