lemmy-ui
lemmy-ui copied to clipboard
Spoiler in part of sentence
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 :
Lemmy has a spoiler feature already although it works slightly different, it's the exclamation in a triangle highlighted in yellow
Lemmy has a spoiler feature already although it works slightly different, it's the exclamation in a triangle highlighted in yellow
@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 :
And ended up looking like :
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.
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)
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
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, 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.
I find this ||spoiler text||
to be a much more palatable format. just my 2 cents.
Now anyone working on this feature would be very cool <3 Thank you all the devs associated with this amazing project
Adding keywords for visibility: inline spoiler
@biosfood When you said that the feature was inplemented in your PR did you mean this Spoiler feature or something different?
@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.
@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.
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.
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.
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.
@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 utilizesdisplay: 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:
The one already used in lemmy-ui
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.
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
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.
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.
@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.
@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.