Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending spoilers #869

Closed
Sorunome opened this issue Sep 16, 2019 · 42 comments
Closed

Sending spoilers #869

Sorunome opened this issue Sep 16, 2019 · 42 comments
Labels

Comments

@Sorunome
Copy link

Is your suggestion related to a problem? Please describe.
Recently rendering spoilers has been merged into riot develop, the problem is now that there is no way of sending them!

Describe the solution you'd like
Sending spoilers as extended markdown like ||spoiler|| and ||reason|spoiler|| seems reasonable.

Describe alternatives you've considered
None, this could be a discussion!

Additional context
||spoiler|| neatly aligns with existing messaging services (e.g. Discord). As for the extended ||reason|spoiler|| it seems similar enough to just a plain spoiler to implement.

@Sorunome
Copy link
Author

A different markdown parser that is more easily customizable would greatly simplify this step, and would also allow things like ~~strikethrough~~. Is there a chance of changing the markdown parser?

@t3chguy
Copy link
Member

t3chguy commented Sep 20, 2019

Is there a chance of changing the markdown parser?

I believe there is scope for this as the experience with CommonMark is kind of unsuitable IMO, especially for markdown in links which is not easily fixable from the consumer level. GFM would be a good shout but I don't see it being extensible to adding spoilers

@aaronraimist
Copy link

@grinapo
Copy link

grinapo commented Dec 6, 2019

  • Stackexchange uses >! spoiler for lines - but it won't suit spoiler words.
  • Discord use ||spoiler|| for inline spoilers. - that's pretty bad for anything containing multiple pipes
  • Reddit uses [] (#s "Spoiler Filled Text") - convoluted...
  • Github uses <details> spoiler </details>, others <spoiler>spoiler text</spoiler>. This doesn't mess up normal text.

I'd go for <spoiler>xx</spoiler> or the S.E. syntax for lines, but that's just me.

@Sorunome
Copy link
Author

Sorunome commented Dec 6, 2019

custom tags are pretty much ruled out IMO as the msc specifically added an attribute to the the span tag to not need to do custom html tags

@dkasak
Copy link
Member

dkasak commented Dec 10, 2019

The pipe syntax is really nice, IMO, and it has the additional benefit of familiarity for Discord users. I don't see multiple pipes in ordinary text as being common enough to warrant dismissing this syntax because of that. The same could be said for a lot of other Markdown special characters.

For situations where you really need pipes, there's /plain ... in Riot. For cases where it occurs in code, code blocks should be used instead anyway.

@theotheroracle
Copy link

Apparently the mobile version of riot uses /spoiler? i'm not sure why that's not implemented here already.

@grinapo
Copy link

grinapo commented Dec 22, 2019

@SaturnSoftware yes but it's only for the whole line, cannot spoilermark words.

@Huy-Ngo
Copy link

Huy-Ngo commented Aug 20, 2020

I've seen bots being able to do this (they are bots bridging the chatroom with discord), so I suppose there must be already a way.

@t3chguy
Copy link
Member

t3chguy commented Aug 20, 2020

Bots don't use Element.
Element can already render spoilers, just has no way for users to send them.

@Sorunome
Copy link
Author

I've seen bots being able to do this (they are bots bridging the chatroom with discord), so I suppose there must be already a way.

yes, /html <span data-mx-spoiler="reason">spoiler content</span>

@shmerl
Copy link

shmerl commented Oct 26, 2020

Using /html ... works, but if you edit that message in element, it stops rendering the spoiler. Is there a way to edit it too?

@aaronraimist aaronraimist added the Help Wanted Extra attention is needed label Nov 16, 2020
@shmerl
Copy link

shmerl commented Feb 9, 2021

Is there any way currently to send an image as a spoiler, not just text?

@theotheroracle
Copy link

theotheroracle commented Feb 9, 2021

as a workaround, you can nest an <img> tag in a <span data-mx-spoiler> tag, but you'd have to upload the image first and get the mxc, there's also no current solution for encrypted rooms .

@theotheroracle
Copy link

Using /html ... works, but if you edit that message in element, it stops rendering the spoiler. Is there a way to edit it too?

you'd have to use devtools

@shmerl
Copy link

shmerl commented Feb 9, 2021

you'd have to upload the image first and get the mxc, there's also no current solution for encrypted rooms .

How do you get an mxc for an image uploaded to somewhere on Matrix and how should it be referred to in <img> tag? Or is it the regular URL of the image that you can find once it's uploaded?

@shmerl
Copy link

shmerl commented Feb 9, 2021

I tested something like this with external image, but that didn't work:

/html <span data-mx-spoiler="spoiler"><img src='https://someurl'/></span>

@theotheroracle
Copy link

no, you can't use http to reference images, only mxc urls are accepted, if you click the three dots and view the source of an image, you can see the mcx:// url

@shmerl
Copy link

shmerl commented Feb 9, 2021

It worked, thanks! Blurring on images is pretty weak though. Should I open a separate bug about it?

@theotheroracle
Copy link

if there isn't one already

@shmerl
Copy link

shmerl commented Feb 9, 2021

I didn't find anything, so I opened vector-im/element-web#16412.

@robintown
Copy link
Member

For the time being, would it be helpful to just add a /spoiler command like the one on Android? I could do that easily.

@shmerl
Copy link

shmerl commented Feb 25, 2021

That would be much nicer than using tags explicitly. But for images there might be a need to have an option to add that during upload.

@theotheroracle
Copy link

theotheroracle commented Feb 27, 2021

if there was an option to spoiler images, it would also be helpful to add an image description field, since it would be an inline image anyways, it wouldn't really be difficult to implement

@gabrc52
Copy link

gabrc52 commented Apr 29, 2021

The ||spoiler|| syntax would certainly be helpful for inline spoilers.

For backwards compatibility, the client could translate it to the HTML format before sending, and a similar way to enable editing.

@t3chguy
Copy link
Member

t3chguy commented Apr 29, 2021

For backwards compatibility, the client could translate it to the HTML format before sending

that's what it would have to do - clients don't render incoming markdown, given that dialects vary so much. The messages on the wire are a Matrix defined subset of HTML.

@TheSmallTeaBoi
Copy link

Any news on this?

@SimonBrandner
Copy link

You can now send a spoiler message using /spoiler <message>

@TheSmallTeaBoi
Copy link

what about single words?

@t3chguy
Copy link
Member

t3chguy commented Jun 4, 2021

That's why this issue is not closed yet. Any updates on that will be right here. But given it is marked as Help Wanted - anyone can pick it up.

@theotheroracle
Copy link

it's blocked by the switch from commonmark i think ?

@TomMettam
Copy link

Please add support for spoiler images, too.

@shmerl
Copy link

shmerl commented Jul 6, 2021

I think images should already work, but blurring can be improved. See related: vector-im/element-web#16412

@TomMettam
Copy link

@shmerl Ah right, but is there a way to do this when attaching an image? Or just linking to one?

@shmerl
Copy link

shmerl commented Jul 6, 2021

yeah, there should be some UI / syntax options for that that are currently absent.

@robintown
Copy link
Member

Spoiler images actually need a spec change to be properly supported, since sending images inline isn't an adequate solution for encrypted rooms.

@robintown
Copy link
Member

I've created an MSC for media spoilers, and split their implementation out into a couple of new issues: element-hq/element-web#18061 https://github.com/vector-im/element-web/issues/18062. If you have ideas for the designs, I encourage you to drop them in there, as it'll help me have a sane first draft to present for design review once I implement this.

@kittykat
Copy link
Contributor

@Sorunome given that we have /spoiler now, does that satisfy your original request or do you feel that there are additional improvements to be made? (Everyone else, please feel welcome to speak up 👍 )

@SimonBrandner
Copy link

@Sorunome given that we have /spoiler now, does that satisfy your original request or do you feel that there are additional improvements to be made? (Everyone else, please feel welcome to speak up +1 )

We can't do Hello world, this is a ||spolier|| or make images (and other things) spoilers

@ShadowJonathan
Copy link

We can't do Hello world, this is a ||spolier|| or make images (and other things) spoilers

Could you elaborate? Is this because of limitations with commonmark libraries?

@SimonBrandner
Copy link

We can't do Hello world, this is a ||spolier|| or make images (and other things) spoilers

Could you elaborate? Is this because of limitations with commonmark libraries?

Ah, I didn't mean that it is technically impossible (I have no idea, but I imagine it is possible). I was simply saying you can't send a message like that in Element atm, afaik

@sumnerevans
Copy link

Another possible syntax is the Reddit-style:

This is >!spoiler text!<

@t3chguy t3chguy transferred this issue from element-hq/element-web Dec 15, 2022
@element-hq element-hq locked and limited conversation to collaborators Dec 15, 2022
@t3chguy t3chguy converted this issue into discussion #870 Dec 15, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests