<Highlight /> with regex #2776
Replies: 3 comments 2 replies
-
It is not a good idea to use Highlight for that, usually in such cases you should inject extra markup to HTML string before rendering it |
Beta Was this translation helpful? Give feedback.
-
Can we at least get some improvement on Textarea like this? https://bonafideduck.github.io/react-highlight-within-textarea |
Beta Was this translation helpful? Give feedback.
-
Hi, While I understand this request has been dismissed as "not a good idea in such cases", I’d like to point out some use cases where this suggestion could potentially be useful, hoping to encourage further discussion.
Additionally, I think supporting a user-defined function would be more versatile than limiting it to regex. |
Beta Was this translation helpful? Give feedback.
-
In our case we need to highlight hashtags like this:

Mark
orHighlight
would do the job but they only accept lists:We'd really need regex to achieve this I think.
Beta Was this translation helpful? Give feedback.
All reactions