-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Expand highlighting functionality to wrapping tag/templates.
It would be nice to extract this code in an external plugin.
Why?
I need not to highlight, but to wrap the word found with a link (for example).
It's almost the same as the backlight, just wrapping tag differently. Another replacement pattern.
return '<span style="background: #' + highlightColor + ';">' + match + '</span>';
return '<a href="/another-page">' + match + '</a>';
highlighting like linking specifically applied - additional functionality, not related to finding bad words. It complements the library well. But there must be the possibility of independent expansion.
As I see it
import Highlighting from highlight-this-text-by-span-or-not-span-tag;
import Wrapper from wrap-specific-tag-this-text;
// ...
Censoring.use(Highlighting);
Censoring.use(Wrapper);
Metadata
Metadata
Assignees
Labels
No labels