reveal.js
reveal.js copied to clipboard
Search breaking words with non-a-z characters (e.g. german umlauts)
Search for words with german umlauts (e.g. "Tastaturkürzel") the search-word is split at the umlaut and instead it is searched for "tastaturk" or "rzel" which doesnt make sense. The problem is the \w - in the regexp which only accounts for a-zA-Z0-9 but not for ä, à or whatever.
Changing the "non-word"-replacement to "|"
this.setRegex = function(input)
{
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
...
to replacing "spacing"-characters into "|"
this.setRegex = function(input)
{
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/\s+/g, "|");
...
helps for me. Might there be any sideeffects of this modification?