RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
126 stars 252 forks source link

markdown shortcuts for bold and italic #147

Closed VenomFate-619 closed 1 year ago

VenomFate-619 commented 1 year ago

As an EmbeddedChat developer

I need to: use the markdown shortcut to edit the text e.g:- Ctrl + B for bold , Ctrl + I for italic

Acceptance Criteria

VenomFate-619 commented 1 year ago

@sidmohanty11 I like to implement this

VenomFate-619 commented 1 year ago

@sidmohanty11

sidmohanty11 commented 1 year ago

@VenomFate-619 so sorry for late reply, please go ahead! For shortcuts please make it compatible with all OS. Thanks!

satti-hari-krishna-reddy commented 1 year ago

Hi @VenomFate-619 are you still working on this issue ?

Yashraj7890 commented 1 year ago

Hi @sidmohanty11 , is this issue still open? I would love to work on this can it be assigned to me if this issue is still open?

sidmohanty11 commented 1 year ago

Go ahead!

Yashraj7890 commented 1 year ago

Hi @sidmohanty11 Just needed some clarification.

Here we are aiming at implementing markdown shortcuts for the user such that the user is able to change the font type of the text message he's going to send.

I hope I'm right here.

sidmohanty11 commented 1 year ago

@Yashraj7890 Yes yes, for example, if I select any word and do Ctrl+B, it should bold it in markdown syntax.

cc @abhinavkrin

abhinavkrin commented 1 year ago

Hey, @Yashraj7890 I think you should target replicating how it is handled currently by the existing action buttons (bold, italic). To explain, when a user presses CTRL+B the selected text should be wrapped with . For example hello there -> `hello there*`. And if no text is selected add * to the position of the cursor and set the cursor position in the middle of the two characters. This should be the ideal solution. You can share if you have any other approach.

Yashraj7890 commented 1 year ago

Noted👍, I'm on it.

Yashraj7890 commented 1 year ago

Hey @abhinavkrin

I have made a pull request which successfully implements the feature with the exact behavior you have decribed.

abhinavkrin commented 1 year ago

Thanks, @Yashraj7890 I have merged the changes.