uiwjs / react-textarea-code-editor

A simple code editor with syntax highlighting.
https://uiwjs.github.io/react-textarea-code-editor/
MIT License
476 stars 22 forks source link

Custom Syntax Highlighting #135

Open emmajane1313 opened 1 year ago

emmajane1313 commented 1 year ago

Is there a way to customise which specific words in the textarea are colored/highlighted based on a custom regex function or similar? I saw the issue regarding the prism plugins but am unclear on how to implement a custom function with these that is not language related.

For example being able to detect words that start with # and color them blue.

Thanks

jaywcjlove commented 1 year ago

@emmajane1313

https://github.com/uiwjs/react-textarea-code-editor/blob/8154d1b4e36ae1d7e09654aec2f2e5df58261ead/src/style/index.less#L3-L63