I am using DraftJS Editor for having Rich Text features in my application's React based web page.
I have the following requirement:
When a user types in # key, a drop down is displayed besides Editor, from where user can choose an option. Depending upon his choice I want to replace # with some HTML, example an image.
I have created logic for showing drop down as soon as user types in # character in the Editor but do not understand how to replace that hash character then with some other HTML/text.
I have googled for finding on how to do this but not able to find so far, one such precise example on this.
Can someone guide on this, better with some example?
Note: I know that there are some DraftJS plugins that provide mentions sort of functionality, but I don't want to use those, rather just want to go on with my own logic using the content replacement thing I mentioned above.