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

Markdown in room topics should be parsed and displayed properly #613

Open
kittykat opened this issue Jun 16, 2023 · 12 comments
Open

Markdown in room topics should be parsed and displayed properly #613

kittykat opened this issue Jun 16, 2023 · 12 comments
Assignees
Labels
A-Room-Detail O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems won't fix X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue

Comments

@kittykat
Copy link
Contributor

kittykat commented Jun 16, 2023

Steps to reproduce

  1. Go to a room which has markdown used in a topic (e.g. [foo](example.com))
  2. Open room detail view from the top bar

Outcome

What did you expect?

Topic is displayed correctly, like on web

What happened instead?

I see the actual markdown which hasn't been parsed

@kittykat kittykat added S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems O-Occasional Affects or can be seen by some users regularly or most users rarely A-Room-Detail labels Jun 16, 2023
@kittykat
Copy link
Contributor Author

@VolkerJunginger What are your thoughts on this issue? Should it be a blocker for closing the room detail page story?

@jmartinesp
Copy link
Member

Just a note:

Topic is displayed correctly, like on web

I believe this happens only if you have enabled the "Show HTML representation of room topics" labs flag.

However, it seems URL links get autodetected and are clickable even without the MD conversion. Would that be enough?

@nadonomy
Copy link

Suggestion - even if we don't implement markdown parsing yet - could be worth converting to plaintext so we don't expose ugly markdown syntax.

@jmartinesp
Copy link
Member

jmartinesp commented Jun 19, 2023

Suggestion - even if we don't implement markdown parsing yet - could be worth converting to plaintext so we don't expose ugly markdown syntax.

Actually, that's probably even harder to achieve 😅 . We'd need to use a markdown parser and then remove anything that's not plain text, which is slightly more work than just using a markdown parser and transforming it to HTML.

@bmarty
Copy link
Member

bmarty commented Sep 6, 2023

Can the conversion of the room topic from markdown to Html be handled by the SDK, either by providing the Html version directly, or by exposing a function to do the conversion? CC @Hywan

@Hywan
Copy link
Member

Hywan commented Sep 6, 2023

That's doable. ruma is already doing it for the case of events (m.text). We should find a way to expose the Markdown parser used by ruma, but clearly doable.

@Hywan Hywan self-assigned this Sep 6, 2023
@Hywan Hywan added the X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue label Sep 6, 2023
@jplatte
Copy link
Contributor

jplatte commented Sep 6, 2023

I thought it was mentioned here before, but doesn't seem so: The only way to put HTML into the topic is MSC3765, so we need to add support for that to Ruma first. Just an an implementation hint, @Hywan :)

@Hywan
Copy link
Member

Hywan commented Sep 6, 2023

Good to know, thanks!

For the moment, we will receive room names from Sliding Sync. I wonder how all that fits within Ruma 🤔.

@jplatte
Copy link
Contributor

jplatte commented Sep 6, 2023

I don't think the two are related, really (room name and room topic)?

@Hywan
Copy link
Member

Hywan commented Sep 6, 2023

Yeah, I just got confused. Taking a look now at adding MSC3765 inside Ruma.

@Hywan
Copy link
Member

Hywan commented Sep 6, 2023

The MSC isn't stable, and the implementation inside Element Web doesn't seem to match the MSC. I don't think any of this is ready to be implemented. I think it needs more preparations.

@Hywan Hywan removed their assignment Sep 6, 2023
@manuroe manuroe added S-Minor Impairs non-critical functionality or suitable workarounds exist and removed S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Feb 23, 2024
@bmarty
Copy link
Member

bmarty commented Mar 8, 2024

Let try to us the Rich Text Editor library to render the topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Room-Detail O-Occasional Affects or can be seen by some users regularly or most users rarely S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Something isn't working: bugs, crashes, hangs and other reported problems won't fix X-Needs-Rust This issue needs a Rust SDK change. It must have a link to a Rust SDK issue
Projects
None yet
Development

No branches or pull requests

9 participants