|
| 1 | +# Allow the HTML `<details>` tag in messages |
| 2 | + |
| 3 | +Currently, there's no available method for bot developers - among others - to provide larger informative |
| 4 | +messages in a room without disrupting the conversation for all other users. This often causes bots |
| 5 | +to appear needlessly "spammy". |
| 6 | + |
| 7 | +## Proposal |
| 8 | + |
| 9 | +This proposal suggests adding the existing HTML tags for `<details>` and `<summary>` to the list of |
| 10 | +allowed tags in formatted Matrix messages. Which would allow for larger messages to be shown simply |
| 11 | +as smaller - and less intrusive - summaries for the users who are not interested in their full contents. |
| 12 | + |
| 13 | +## Tradeoffs |
| 14 | + |
| 15 | +An alternative method to provide a summary/details split could possibly be done through [MSC1767], |
| 16 | +with the details and summaries being specified through repeated bodies with added metadata. This could |
| 17 | +then also allow clients better autonomy in deciding what to display - or how to structure the information. |
| 18 | + |
| 19 | +However, allowing the use of the `<details>` and `<summary>` tags would still offer richer formatting |
| 20 | +capabilities even in such messages, especially as more than one detail/summary block could be included |
| 21 | +in a single message. |
| 22 | + |
| 23 | +## Potential issues |
| 24 | + |
| 25 | +Allowing more HTML tags in formatted messages could cause more work for client developers, as they would |
| 26 | +have to fit a larger and more diverse corpus of input into their designs and user experience. |
| 27 | +However, these are both well documented - and implemented - HTML tags, so there is plenty of prior work |
| 28 | +available to take example from in how to incorporate them. |
| 29 | + |
| 30 | +Additionally, as the addition of these tags will make it possible to fit even more information into |
| 31 | +a single message without worry of overflowing the room, any client that doesn't render the formatting |
| 32 | +of the body might end up with a lessened user experience - from either an under- or overflow of information. |
| 33 | + |
| 34 | +The onus on ensuring that the unformatted body is a reasonable representation of the message has always |
| 35 | +been on the user or bot writing the formatted message though, so providing an improved ability for |
| 36 | +formatting should not negatively affect the experience for any clients that simply render unformatted |
| 37 | +text. |
| 38 | + |
| 39 | +## Security considerations |
| 40 | + |
| 41 | +Allowing more HTML tags in client rendering could lead to a wider attack surface for DOM-based exploits. |
| 42 | +However, these tags are very simple in both function and design, so any possible attack surface they |
| 43 | +would offer would be minimal at best. |
| 44 | + |
| 45 | +[MSC1767]: https://github.com/matrix-org/matrix-doc/blob/matthew/msc1767/proposals/1767-extensible-events.md |
0 commit comments