Datatables - Search string containing an Apostrophe
Datatables - Search string containing an Apostrophe
Hi all,
Hoping that this community will be able to assist in getting my issue taken care of.
Issue explanation:
Currently have DataTables implemented though a wordpress plugin called "WPDownloadManager". (I have already tried support through the plugin developer and he claims it to be a DataTables issue.) When I attempt to search a string containing an apostrophe (i.e. that's) the search returns no results even though there are several instances of that string inside my table.
I have attempted to search through the plugins code to see if DataTables was implemented incorrectly in regards to the search feature, but it seems that all search code is contained inside of the DataTables.js (which is beyond me to troubleshoot).
Background:
Running version 1.10.4
Website experiencing issue - http://growingstems.org/activity-plans/stem-in-the-park/
Please let me know if more information is required.
Any assistance would be appreciated.
Thanks!
This question has an accepted answers - jump to answer
Answers
Still looking for some support with this issue. I have been unable to locate anything that looks incorrect.
Any assistance would be appreciated.
Thanks!
Thanks for the link. The problem is that you are probably searching for a simple
'
keypress (character code 39), but your data contains "special" apostrophes (’
- character code 8217).So the issue that you are seeing is that
’ !== '
and therefore no match occurs.The easiest fix is to replace the special apostrophes with simple regular ones.
Allan
Thank you very much! I honestly had no idea there were such things as "special" apostrophes. It seems that WordPress automatically replaces the normal ones with the "special" ones.
Figured out a way to filter them back and everything looks to be working.
I appreciate you assistance with this issue!
I think Apple calls them "smart apostrophes" in OSX. MS Word does something similar since the standard apostrophe has horrible styling (generally speaking). So many editors (including WordPress by the sounds of things) uses a higher UTF character to look nicer.
Good to hear you have a work around.
Allan