mautrix / discord

A Matrix-Discord puppeting bridge
https://go.mau.fi/mautrix-discord
GNU Affero General Public License v3.0
240 stars 22 forks source link

Quoted replies generated by Discord bots are not shown correctly (the reply is quoted as well) #104

Open wapsi opened 1 year ago

wapsi commented 1 year ago

If bot in Discord uses quoting when replying to some message, the whole message (including the reply to the quoted message) will shown as quoted in Matrix (Element).

Here is a sample screenshot how the message is seen in the official Discord chat:

image

That message is shown in Element like this:

image

So, as you can see, the reply is just embedded into that quoteblock element too.

I checked by using the Firefox inspection tool that the HTML code and elements are like this in that message:

<a href="xxx" aria-label="10:29">
  <span class="mx_MessageTimestamp" title="xxx" aria-hidden="true" aria-live="off">10:29</span>
</a>
<div class="mx_MTextBody mx_EventTile_content">
  <span class="mx_EventTile_body markdown-body" dir="auto">
    <blockquote>
      <p>
        <span>
          <bdi>
            <a class="mx_Pill mx_UserPill mx_UserPill_me" href="xxx" aria-describedby="xxx">
              <img loading="lazy" class="mx_BaseAvatar mx_BaseAvatar_image" src="xxx?width=16&amp;height=16&amp;method=crop" style="width: 16px; height: 16px;" alt="" data-testid="avatar-img" aria-hidden="true">
              <span class="mx_Pill_text">yyy</span>
            </a>
          </bdi>
        </span>: ... ne suoraan syslog-palvelun kautta johki /var/log/syslog jne. <br> Se init-skriptien ...
      </p>
    </blockquote>
  </span>
</div>

So, as you can see, the Bridge (I assume) does not separate that reply and the quoted message: they are both inside the same <blockquote> element, there is just one <br> tag between them.

HonbraDev commented 11 months ago

From what I can see, this is more of an issue with Discord's non-standard Markdown not being parsed correctly. The bridge parses and sends it as one blockquote.

image image image