linagora / Twake

Twake is a secure open source collaboration platform to improve organizational productivity.
https://twake.app
GNU Affero General Public License v3.0
1.79k stars 194 forks source link

Editor suggestions should be handled differently in code and quote blocks #1494

Open chamerling opened 3 years ago

chamerling commented 3 years ago

At least for code, having mentions needs special handling because for now it produces raw mention with user ID.

chamerling commented 3 years ago
  1. Mention in quote is working as mention in classical block and will be rendered as mention component
  2. Mention in code block is transformed to raw text like "@John Doe"
RomaricMourgues commented 3 years ago

If you have specific code for the code block maybe remove spaces to make it look more codish ?

On 28 Jul 2021, at 16:28, Christophe Hamerling @.***> wrote:

 Mention in quote is working as mention in classical block and will be rendered as mention component Mention in code block is transformed to raw text like @.*** Doe" — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hantt12 commented 3 years ago

This is how it looks now image.png

chamerling commented 3 years ago

Hum, this is not what is expected :). I think that the issue is the way @XXX are handled before being sent to the backend. Looks like some ids are added in some cases. Will have a look to this

chamerling commented 3 years ago

Looks lile your username is the same as your full name, which is bad. Going to find a solution.

chamerling commented 3 years ago

@RomaricMourgues this function is pretty annoying: https://github.com/linagora/Twake/blob/39cf213d952cc2a67bb8be5755974de24c8b6076/twake/frontend/src/app/services/Twacode/pseudoMarkdownCompiler.js#L291

It replaces @sometext with @somtext:id if sometext is a username. What is we just want to have @sometext in the output message?

RomaricMourgues commented 3 years ago

This method should ignore everything inside ` and ``` no ?

On 30 Jul 2021, at 17:00, Christophe Hamerling @.***> wrote:

 @RomaricMourgues this function is pretty annoying: https://github.com/linagora/Twake/blob/39cf213d952cc2a67bb8be5755974de24c8b6076/twake/frontend/src/app/services/Twacode/pseudoMarkdownCompiler.js#L291

It replaces @sometext with @somtext:id if sometext is a username. What is we just want to have @sometext in the output message?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

RomaricMourgues commented 3 years ago

I am looking at this and I am wondering if we still need it anymore. At least for the user part (the channel part is still needed if not handled by the new text editor)

RomaricMourgues commented 3 years ago

After some trials, we cannot remove the current method. I propose we consider this as a edge case and we wait for the "blocks" message builder system to be implemented before to retest this issue.