You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updating our config.Message to support something like Slack's blocks. We can have blocks for "text", "mentions", "emoji", and "embed" (similar to a Discord embed), and more if necessary.
However, for bold/italics/strike/urls and so on, instead of going crazy with blocks, we should instead normalise text markup.
We can do this by having source bridgers parse the text and convert the markup to a markdown dialect of our choice (CommonMark? GFM?). Then the destination bridgers will convert from our chosen markdown dialect, to the destination bridge's dialect.
For example, a user sends a message ~~markdown~~ on Discord. Our Bdiscord converts this to CommonMark, resulting in the config.Message.Text being ~~markdown~~ (no difference). The gateway sends this config.Message to Bslack. Inside Bslack we convert config.Message.Text to ~markdown~, making it appear correctly on Slack.
Note: Slack's markup language is called mrkdwn, and is described here as their "proprietary textual markup that's just different enough from Markdown to frustrate you". mrkdwn is specced out here.
Slack is a prick for calling it mrkdwn, and not SlackMarkdown or something more human-friendly.
Describe alternatives you've considered
Add CleanSourceMessage to the bridge.Bridger interface, which is called by the gateway per-message with a list of target platforms, so that e.g. Bdiscord.CleanSourceMessage can clean messages differently for different target platforms.
This involves hardcoding special behaviour for other bridges inside unrelated bridges.
It need not be as expansive as what Slack supports — it will be lossy. Slack's use case is too complicated and is meant for complex bot layouts.
When I tell people about matterbridge, I ask them if they've heard of pandoc, and say "it's basically pandoc but for chat platforms". This would extend the analogy and include support for converting text markup.
The text was updated successfully, but these errors were encountered:
Just tested and confirmed the behavior.. Discord formatting for Bold/Italic/BoldItalic is different from Slack formatting for the
same, so messages are displayed "wrong" when bridged to the other side. Using a standard markup language and making each system convert it's unique markup syntax to the internal one and then converting back on the other side would allow for a much better experience on both sides, with formatting codes (not shown on the source) correctly mapped or at worst turned to plain text on the other side.
Is your feature request related to a problem? Please describe.
Bridging between the same platform should transfer mentions, emoji and embeds better. Text formatting isn't consistent between platforms.
Describe the solution you'd like
Updating our
config.Message
to support something like Slack'sblocks
. We can have blocks for "text", "mentions", "emoji", and "embed" (similar to a Discord embed), and more if necessary.However, for bold/italics/strike/urls and so on, instead of going crazy with blocks, we should instead normalise text markup.
We can do this by having source bridgers parse the text and convert the markup to a markdown dialect of our choice (CommonMark? GFM?). Then the destination bridgers will convert from our chosen markdown dialect, to the destination bridge's dialect.
For example, a user sends a message
~~markdown~~
on Discord. OurBdiscord
converts this to CommonMark, resulting in theconfig.Message.Text
being~~markdown~~
(no difference). The gateway sends thisconfig.Message
toBslack
. InsideBslack
we convertconfig.Message.Text
to~markdown~
, making it appear correctly on Slack.Note: Slack's markup language is called
mrkdwn
, and is described here as their "proprietary textual markup that's just different enough from Markdown to frustrate you".mrkdwn
is specced out here.Slack is a prick for calling it
mrkdwn
, and notSlackMarkdown
or something more human-friendly.Describe alternatives you've considered
Add
CleanSourceMessage
to thebridge.Bridger
interface, which is called by the gateway per-message with a list of target platforms, so that e.g.Bdiscord.CleanSourceMessage
can clean messages differently for different target platforms.This involves hardcoding special behaviour for other bridges inside unrelated bridges.
Additional context
High level - see Slack's: layout blocks (specifically "section", but also "file" and "image") and composition objects (specifically "text").
It need not be as expansive as what Slack supports — it will be lossy. Slack's use case is too complicated and is meant for complex bot layouts.
When I tell people about matterbridge, I ask them if they've heard of pandoc, and say "it's basically pandoc but for chat platforms". This would extend the analogy and include support for converting text markup.
The text was updated successfully, but these errors were encountered: