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

Add support for Markdown spoiler tags #56

Closed
wants to merge 2 commits into
base: master
from

Conversation

3 participants
@empyrical
Copy link

empyrical commented May 10, 2014

Over on Stack Exchange, they implemented spoiler tags this way:

>! spoiler!

Which would get rendered as:

<blockquote class="spoiler">spoiler!</blockquote>

Built-in spoiler markdown is a popular request on reddit, and I think this'll make spoilers much nicer to use on reddit (especially on mobile). This won't support inline spoilers, though; some other syntax will need to be implemented.

In a commit to reddit, I committed the needed CSS.

@andre-d

This comment has been minimized.

Copy link
Contributor

andre-d commented May 10, 2014

I think some of the reads you do do not check the size available correctly
(i+1)and such.
On May 10, 2014 5:40 PM, "ArrestedDevelopment" notifications@github.com
wrote:

Over on Stack Exchange, they implemented spoiler tags this way:

! spoiler!

Which would get rendered as:

spoiler!

Built-in spoiler markdown is a popular request on reddit, and I think
this'll make spoilers much nicer to use on reddit (especially on mobile).
This won't support inline spoilers, though; some other syntax will need to
be implemented.

In a commit to reddit, I committed the needed CSS.

You can merge this Pull Request by running

git pull https://github.com/ArrestedDevelopment/snudown spoiler

Or view, comment on, or merge it at:

#56
Commit Summary

  • Adding parser code for spoiler tags

File Changes

  • M html/html.chttps://github.com//pull/56/files#diff-0(10)
  • M src/markdown.chttps://github.com//pull/56/files#diff-1(66)
  • M src/markdown.hhttps://github.com//pull/56/files#diff-2(1)

Patch Links:


Reply to this email directly or view it on GitHubhttps://github.com//pull/56
.

@empyrical

This comment has been minimized.

Copy link
Author

empyrical commented May 11, 2014

💇 Added the proper check. I missed that, thanks

@empyrical

This comment has been minimized.

Copy link
Author

empyrical commented May 20, 2014

How would you feel about an inline-compatible spoiler syntax that works like this:

This sentence contains >!spoiler text!< in it.

and renders as:

This sentence contains <span class="spoiler">spoiler text</span> in it.

?

@empyrical

This comment has been minimized.

Copy link
Author

empyrical commented May 24, 2014

💇 I decided to take a crack at implementing this. Also, I added a tweak to prefix_blockspoiler so if there's a line that starts like this:

>!This is a spoiler!< inside of a sentence

It'll render as a span, instead of a blockquote with an awkwardly placed !< in it.

@empyrical empyrical changed the title Adding Stack Exchange-style spoiler tags Add support for Markdown spoiler tags May 30, 2014

@empyrical empyrical closed this Jul 2, 2015

@empyrical empyrical referenced this pull request Nov 18, 2018

Merged

Add blockspoiler support #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment