Hi all!
I have a custom function for filtering hints, which filters a list of completions with a fuzzy-matching function. I want to highlight the sections of the completions that were matched against the search-term, so I marked with <span class="highlight">
s.
For some context, here is the code-section that returns sthe result of the filtering (using the fuzzy.js-library):
return {
list: fuzzy.filter(search, completions, { before: '<span class="highlight">', after: '</span>' }),
from: new CodeMirror.Pos(cursor.line, cursor.ch - currentWord.length),
to: cursor,
};
Unfortunately, the hint-terms get HTML-escaped, so the <span...
is not treated as HTML, but shown as text.
Is there a way to treat the result (the list:
-array in the code above) as HTML, not pure text?