matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
462 stars 151 forks source link

<a> tags prevent messages from being formatted #1581

Open progval opened 2 years ago

progval commented 2 years ago

Describe the bug tags in the formatted_body of org.matrix.custom.html messages cause the body to be used instead of the formatted_body

To Reproduce

Send this:

{
    "body": "**warpfork** created new issue [matrix-org/matrix-appservice-irc#1580](https://github.com/matrix-org/matrix-appservice-irc/issues/1580)",
    "format": "org.matrix.custom.html",
    "formatted_body": "<strong>warpfork</strong> created new issue <a href=\"https://github.com/matrix-org/matrix-appservice-irc/issues/1580\">matrix-org/matrix-appservice-irc#1580</a>",
    "msgtype": "m.notice"
}

and this:

{
    "body": "**warpfork** created new issue",
    "format": "org.matrix.custom.html",
    "formatted_body": "<strong>warpfork</strong> created new issue",
    "msgtype": "m.notice"
}

This sends the following to IRC:

**warpfork** created new issue matrix-org/matrix-appservice-irc#1580 warpfork created new issue

Expected behavior

It should send this:

warpfork created new issue matrix-org/matrix-appservice-irc#1580 warpfork created new issue

Or, even better:

warpfork created new issue matrix-org/matrix-appservice-irc#1580 <https://github.com/matrix-org/matrix-appservice-irc/issues/1580> warpfork created new issue

(disregard the monospace formatting, I had to add it to prevent github from doing its own formatting)

Half-Shot commented 2 years ago

I think this just needs our parsing to be updated to support a tags.