Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Slash command inside a paragraph tag in rich text editor does not work in the timeline #704

Closed
alunturner opened this issue Jun 5, 2023 · 0 comments · Fixed by #834
Closed

Comments

@alunturner
Copy link
Contributor

alunturner commented Jun 5, 2023

In the rich text editor, we start out with an empty composer. If the user inserts a new paragraph, then removes a paragraph, although the composer looks empty, it in fact contains a single p tag. This changes the output in the message body as shown.

steps model
start composer ""
insert command "/sample_command"
remove all text ""
insert a paragraph "<p>&nbsp;</p><p>&nbsp;</p>"
remove a paragraph "<p>&nbsp;</p>"
insert command "<p>/sample_command</p>"

This means that if a user sends a slash command after these steps, it is incorrectly recognised (due to the opening of the p tag) and incorrectly processed. The slash commands seems to be designed to work with a string of text arguments after the command, so we could simply strip the opening and closing p tags from a message before we send it.

This could also potentially be rolled into the task #679, as we could simply output a raw text string if the rust model detects that the message starts with a command. I think this would be the neatest solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants