lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

Spoiler in part of sentence

Open jakariyaa opened this issue 2 years ago • 23 comments

Markdown feature to add spoiler in part of sentence (some words or more) like on reddit, the spoiler appears as a grayed block where you press to reveal it :

IMG_20220616_103030

jakariyaa avatar Jun 16 '22 04:06 jakariyaa

Lemmy has a spoiler feature already although it works slightly different, it's the exclamation in a triangle highlighted in yellow lemmyspoiler

DMTryptamines avatar Jun 16 '22 13:06 DMTryptamines

Lemmy has a spoiler feature already although it works slightly different, it's the exclamation in a triangle highlighted in yellow lemmyspoiler

@DMTryptamines Yes I know. But it doesn't have a option to mark a word as spoiler in sentence without breaking the entire line. A simple spoiler markdown symbol like >! would be much better.

What I wanted something to look like :

IMG_20220618_172523

And ended up looking like :

IMG_20220618_173028

jakariyaa avatar Jun 18 '22 11:06 jakariyaa

It looks like there are now some markdown-it spoiler plugins: https://github.com/search?q=markdown+it+spoiler

I'd accept a PR for one. They should support multi-line spoilers tho, like the current one does.

dessalines avatar Jun 18 '22 17:06 dessalines

just want to add that reddit's spoiler tags, as far as i can see, are not keyboard accessible (and i don't know how well they do with screen readers)

ZeusOfTheCrows avatar Jun 29 '23 12:06 ZeusOfTheCrows

I'd much prefer

<spoiler></spoiler>

tags like https://help.disqus.com/en/articles/1717306-spoiler-tags has compared to >!!<, since they'd be a lot more easily readable, because non-text tags are parsed slightly differently by the HTML parser

<!-- -->

is one of the tags negatively affected by this. See https://stackoverflow.com/questions/442786/are-nested-html-comments-possible#comment27159111_12102131

RokeJulianLockhart avatar Jul 03 '23 21:07 RokeJulianLockhart

I'd much prefer

<spoiler></spoiler>

tags like Disqus has compared to >!!<, since they'd be a lot more easily readable, because non-text tags are parsed slightly differently by the HTML parser

Lemmy uses Markdown for comments. Why bring HTML syntax into this? Also, why are you feeding unsanitized Lemmy comments into an HTML parser?

ChaoticNeutralCzech avatar Jul 04 '23 21:07 ChaoticNeutralCzech

@ChaoticNeutralCzech, doesn't Lemmy also support HTML? I've rarely had instances where a Markdown implementation wasn't implemented as a superset of HTML. Consdering that we're discussing how to implement a specific tag-based format delimiter, consistency is important.

RokeJulianLockhart avatar Jul 05 '23 15:07 RokeJulianLockhart

I find this ||spoiler text|| to be a much more palatable format. just my 2 cents.

TeoTwawki avatar Aug 21 '23 19:08 TeoTwawki

Now anyone working on this feature would be very cool <3 Thank you all the devs associated with this amazing project

Celestine20 avatar Aug 21 '23 19:08 Celestine20

Adding keywords for visibility: inline spoiler

foresto avatar Oct 06 '23 18:10 foresto

@biosfood When you said that the feature was inplemented in your PR did you mean this Spoiler feature or something different?

DraconicNEO avatar Oct 08 '23 07:10 DraconicNEO

@DraconicNEO I am sory for the misunderstanding, The PR added support for markdown inside the title of a spoiler, not the shorthand so this issue should stay open.

biosfood avatar Oct 08 '23 10:10 biosfood

@DraconicNEO I am sory for the misunderstanding, The PR added support for markdown inside the title of a spoiler, not the shorthand so this issue should stay open.

Ah I see, thanks for clarifying.

DraconicNEO avatar Oct 09 '23 06:10 DraconicNEO

As someone who will sometimes write the markdown format while I type, I definitely prefer the >!spoiler!< method that is more consistent with the way formatting is achieved for bold, italics, etc. Switching to HTML for one formatting option is confusing to the user, IMO.

IndefiniteBen avatar Oct 18 '23 09:10 IndefiniteBen

As someone who will sometimes write the markdown format while I type, I definitely prefer the >!spoiler!< method that is more consistent with the way formatting is achieved for bold, italics, etc. Switching to HTML for one formatting option is confusing to the user, IMO.

I agree, it makes it easier to selectively blank out parts of a sentence or post which are spoilers, the drop down method is better for whole paragraphs but not for marking sentences or parts of sentences as spoilers.

DraconicNEO avatar Apr 03 '24 20:04 DraconicNEO

https://github.com/LemmyNet/lemmy-ui/issues/687#issuecomment-2035550744

@DraconicNEO, merely having utilizing the HTML <spoiler> tag instead doesn't mean that the <details> drop-down syntax be utilized (display: block;) just as utilizing custom >!spoiler!< syntax would inherently mean that it utilizes display: inline;. I would indeed prefer too for Lemmy to set:

spoiler {display: inline;}

I see little reason for custom features to not adhere to at least standard markup syntax, considering that it makes it more portable.

RokeJulianLockhart avatar Apr 03 '24 21:04 RokeJulianLockhart

#687 (comment)

@DraconicNEO, merely having utilizing the HTML <spoiler> tag instead doesn't mean that the <details> drop-down syntax be utilized (display: block;) just as utilizing custom >!spoiler!< syntax would inherently mean that it utilizes display: inline;. I would indeed prefer too for Lemmy to set:

spoiler {display: inline;}

I see little reason for custom features to not adhere to at least standard markup syntax, considering that it makes it more portable.

When I said drop down I worded it wrong, I meant this: image

The one already used in lemmy-ui

DraconicNEO avatar Apr 04 '24 02:04 DraconicNEO

https://github.com/LemmyNet/lemmy-ui/issues/687#issuecomment-2036011353

Yeah, @DraconicNEO, I hate that too. It's like they just create a <details> tag with the <summary> set to "Spoiler text" by default.

RokeJulianLockhart avatar Apr 04 '24 13:04 RokeJulianLockhart

There is currently no standardization of spoiler tags in commonmark: https://talk.commonmark.org/search?q=spoiler , and reddit has their own unique spoiler markup that we don't follow.

We're currently following markdown-it 's recommended way of doing spoilers, that's also extensible to other types of content.

There are also these: https://github.com/search?q=markdown+it+spoiler&type=repositories

dessalines avatar Apr 04 '24 15:04 dessalines

I personally don't care much (I do prefer something easy to type on a touch keyboard) about the exact syntax, but this issue is about the lack of any way to include an inline spoiler.

Do any of those search results (like https://github.com/traPtitech/markdown-it-spoiler/) support inline spoilers? From the discussion so far I get the impression this issue should be closed as "won't fix", unless one of those search results adds support for inline spoilers.

IndefiniteBen avatar Apr 08 '24 13:04 IndefiniteBen

There is currently no standardization of spoiler tags in commonmark: https://talk.commonmark.org/search?q=spoiler , and reddit has their own unique spoiler markup that we don't follow.

Is there any reason we couldn't use it or maybe do something similar just with different symbols? I mean I've seen a few other sites use that type of spoiler syntax. Also I don't think if we did do it that we should get rid of the current one, and instead we could have both together, as the current one is still useful for some situations and applications.

DraconicNEO avatar Apr 08 '24 20:04 DraconicNEO

@IndefiniteBen the one you linked works with inline spoilers.

I'm also not against us using any style, as long as at least a few platforms use it. I don't want to start yet another competing markup just because of commonmark's slowness on picking one. I'd be interested to know in addition to reddit's inline spoiler markup, what other platforms like Discourse, Discord, and any others anyone can think of use.

dessalines avatar Apr 09 '24 14:04 dessalines

@IndefiniteBen the one you linked works with inline spoilers.

I'm also not against us using any style, as long as at least a few platforms use it. I don't want to start yet another competing markup just because of commonmark's slowness on picking one. I'd be interested to know in addition to reddit's inline spoiler markup, what other platforms like Discourse, Discord, and any others anyone can think of use.

Misskey and many misskey instances also have a blur option as a form of inline spoiler, not sure how widespread its use is though.

I'm personally for using the >!spoiler!< (inline) and >!spoiler (block) as outlined here since it seems they are already widely used by sites similar to Lemmy's form and function like Stack and Reddit, thus people are already very familiar with their use.

DraconicNEO avatar Apr 10 '24 23:04 DraconicNEO