@@ -3,25 +3,28 @@ Sometimes, while you want to put text into a spoiler to not have people accident
33
44For example, when discussing a new movie or a TV series, not everyone might have watched it yet.
55In such cases it would make sense to add a spoiler so that only those who have seen the movie or
6- don't mind spoilers read the content.
6+ don't mind spoilers read the content.
77Another example would be e.g. in mental health communities where certain people have certain
88triggers. People could put talking about abuse or the like into a spoiler, to not accidentally
9- trigger anyone just reading along the conversation.
9+ trigger anyone just reading along the conversation.
1010Furthermore this is helpful for bridging to other networks that already have a spoiler feature.
1111
1212To render the spoiler the content is hidden and then revealed once interacted somehow
1313(e.g. a click / hover).
1414
1515## Proposal
1616This proposal is about adding a new attribute to the ` formatted_body ` of messages with type
17- ` m.room.message ` and msgtype ` m.text ` .
17+ ` m.room.message ` and message types which support the ` org.matrix.custom.html ` format .
1818
1919It adds a new attribute, ` data-mx-spoiler ` , to the ` <span> ` tag. If the attribute is present the
2020contents of the span tag should be rendered as a spoiler. Optionally, you can specify a reason for
2121the spoiler by setting the attribute string. It could be rendered, for example, similar to this:
2222
2323![ Spoiler rendering idea] ( images/2010-spoiler-example.gif )
2424
25+ The plaintext fallback supported by the ` body ` is optional. A recommendation for clients is included
26+ below.
27+
2528To preserve the semantics of a spoiler in the plaintext fallback it is recommended to upload the contents of the spoiler
2629as a text file and then link this: ` [Spoiler](mxc://someserver/somefile) ` and
2730` [Spoiler for reason](mxc://someserver/somefile) ` respectively.
0 commit comments