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

Parse Matrix mentions from HTML #692

Closed
jonnyandrew opened this issue May 24, 2023 · 2 comments
Closed

Parse Matrix mentions from HTML #692

jonnyandrew opened this issue May 24, 2023 · 2 comments

Comments

@jonnyandrew
Copy link
Contributor

jonnyandrew commented May 24, 2023

Room and user mentions

When setting the content of the editor from HTML, the editor should parse links matching the Matrix permalink format as mentions.

A URL is a mention if it has the Matrix URI scheme or is a Matrix.to link:

  • Matrix URI scheme: matrix:[//{authority}/]{type}/{id without sigil}[/{type}/{id without sigil}...][?{query}][#{fragment}] (see also recommended parser implementation)
  • Matrix.to: https://matrix.to/#/<identifier>[/<extra parameter>][?<additional arguments>]

Apps also seem to create and accept custom matrix.to style mentions:

  • Custom app mention: https://<app-host>/#/<type>/<identifier>[/<optional-event-id>][?<optional-query>]

where

  • <app-host> is one of a set of supported hosts defined by the host application (e.g. app.element.io)
  • <type> is one of room, user or group (see MatrixToConverter).

Whole room mentions (@room)

When setting the content of the editor from HTML, the editor should parse plain text that matches the pattern @room as a mention.

@jonnyandrew
Copy link
Contributor Author

Most of the functionality required here should already be part of ruma (see matrix_uri.rs)

@artcodespace
Copy link
Contributor

Addressed in 1bf905d

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