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

Automatically describe mention type in HTML #709

Closed
jonnyandrew opened this issue Jun 6, 2023 · 1 comment
Closed

Automatically describe mention type in HTML #709

jonnyandrew opened this issue Jun 6, 2023 · 1 comment

Comments

@jonnyandrew
Copy link
Contributor

jonnyandrew commented Jun 6, 2023

Problem

To help with rendering of mentions, web clients attach attributes to the HTML link tag <a> to identify the link as a mention and keep track of it's type. Now that this library is responsible for parsing Matrix mentions, this is no longer necessary.

Solution 1

Solution 2

Depends on

Given some mentions are parsed by the library into a mention nodes:

<a href="https://matrix.to/#/@test:example.org">test</a>
<a href="https://matrix.to/#/#test:example.org">#test:example.org</a>

When I get the internal content as HTML (get_content_as_html()), it should have the data-mention-type attribute with an appropriate value (room or user):

<a href="https://matrix.to/#/@test:example.org" data-mention-type="user">test</a>
<a href="https://matrix.to/#/#test:example.org" data-mention-type="room">#test:example.org</a>

Note that get_content_as_message_html() should not return this attribute.

@jonnyandrew jonnyandrew changed the title Automatically add data-mention-type attribute to mention HTML Automatically describe mention type in HTML Jun 9, 2023
@alunturner
Copy link
Contributor

Addressed in release 2.3.0

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

No branches or pull requests

2 participants