Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make links clickable in messages #302

Open
Haeleon opened this issue Aug 10, 2024 · 3 comments
Open

Make links clickable in messages #302

Haeleon opened this issue Aug 10, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request text-chat This is related to the Text Chat widget

Comments

@Haeleon
Copy link
Contributor

Haeleon commented Aug 10, 2024

Title. Some valid types of links should be converted to hyperlinks for quick access; this feature could also set up for creating fuller text rendering later.

@Haeleon Haeleon self-assigned this Aug 10, 2024
@kilbouri
Copy link
Contributor

I would suggest approaching this from a two-step perspective:

  1. the message is transformed when sent into real markdown (e.g. unmasked links become links masked as their URL)
  2. every message is rendered with markdown, the content is not transformed (neglecting any transformation required for custom markdown like Discord's negative heading)

This approach means that we probably need to store both the "original" content and the "transformed" content, otherwise when a user edits their message it won't contain the same plaintext in all cases.

@Haeleon
Copy link
Contributor Author

Haeleon commented Aug 13, 2024

I think I get what you mean.

In other words, the first step ("transforming") would be tweaking the plaintext of the message to essentially remove some syntax sugar, and the second step ("rendering") would be generating the styled HTML from that tweaked text. Is this correct?

@kilbouri
Copy link
Contributor

Not nessarily removing syntax sugar (if we don't support things yes, we'd remove them) but rather taking plaintext and making markdown. For example if the user types a code block, we want to make sure that code block exists as Markdown expects (regardless of how we represent it ourselves). If a user types a link, we automatically mask it behind the scenes so it becomes a hyperlink when rendered.

The second step would be exactly that - there are even libraries to render markdown already, we probably don't need to brew our own for an MVP.

@kilbouri kilbouri added enhancement New feature or request text-chat This is related to the Text Chat widget labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request text-chat This is related to the Text Chat widget
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants