react-md-editor icon indicating copy to clipboard operation
react-md-editor copied to clipboard

Custom markdown tag with action

Open jstiburek opened this issue 2 years ago • 9 comments

Hello, I have kinda similar use case as issue https://github.com/uiwjs/react-md-editor/issues/454.

Is there way to catch a char in actual writing with rehypeRewrite ? I want to detect when user write @ and show him options to select users to tag. Then replace text behind @ with selected option.

Thank you

jstiburek avatar Mar 27 '23 12:03 jstiburek

I think it should be possible. @jstiburek

jaywcjlove avatar Mar 27 '23 12:03 jaywcjlove

I tried it but it's detecting whole string not by a character. :/ I mean all text from editor, it doesn't detect when I'm typing. @jaywcjlove

jstiburek avatar Mar 27 '23 12:03 jstiburek

It may not be easy to achieve, but would you like to listen to the input event of the input box in the preview area? @jstiburek

jaywcjlove avatar Mar 28 '23 01:03 jaywcjlove

why preview area? shouldn't that be an editor area? or you mean listen in preview area and do action in an editor area? kinda confused @jaywcjlove

jstiburek avatar Mar 28 '23 07:03 jstiburek

@jaywcjlove any idea here? or will I have to go another way?

thanks

jstiburek avatar Apr 03 '23 06:04 jstiburek

This is easy to achieve if you replace @xxx in the preview area, I don't know if you think so.

@jstiburek

jaywcjlove avatar Apr 03 '23 14:04 jaywcjlove

@jaywcjlove

I will look more into it. You mean to add tag in editor mode and check and pop submenu in editor mode right?

jstiburek avatar Apr 03 '23 18:04 jstiburek

Oh, you confuse me, I don't understand what you want?

Do you need the following 👇 this effect?

image

Or 👇:

image

jaywcjlove avatar Apr 04 '23 05:04 jaywcjlove

@jaywcjlove sorry for confusion, first one

jstiburek avatar Apr 04 '23 10:04 jstiburek