reveal.js icon indicating copy to clipboard operation
reveal.js copied to clipboard

Search breaking words with non-a-z characters (e.g. german umlauts)

Open stvogel opened this issue 3 years ago • 1 comments

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?

stvogel avatar Jun 23 '21 17:06 stvogel