Integrating accent folding into DataTables JS library

Integrating accent folding into DataTables JS library

tranitrani Posts: 2Questions: 1Answers: 0

Hi everyone, I'm looking into building a WordPress site using the TablePress plugin, but have found that the searchbar functionality does not support accent folding by default. For instance, typing 'u' in the searchbar will not show any results containing 'ü'.

Yesterday I asked in the WordPress forums if there was a way to integrate accent folding into the JS (https://wordpress.org/support/topic/accent-folding-in-searchbar/), and the TablePress' creator suggested that, since his plugin uses the DataTables JS library, I could ask in these forums how to integrate this feature into that library. I am a complete novice with JavaScript, so I'd be grateful for any help! Thanks in advance!

Answers

  • tranitrani Posts: 2Questions: 1Answers: 0

    I should also say, some of the characters I'm dealing with include 'œ' and 'ð', which I would like to be searchable by 'oe' and 'd' respectively. This solution - https://www.datatables.net/plug-ins/filtering/type-based/accent-neutralise - works for single letters with regular diacritics, but not 'custom' cases such as the two examples mentioned in this post. Is custom accent folding possible within the DataTables JS library, and how might it be done?

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    Hi @trani ,

    It would be worth trying with the accent neutralise filtering plugin. I'm not sure if it will work with the examples in your second post, but if not, you could create your own plugin that does something similar to the accent neutralise.

    Cheers,

    Colin

This discussion has been closed.