Quantcast
Channel: What could a "spoiler tag" extension look like?
Viewing all articles
Browse latest Browse all 38

What could a "spoiler tag" extension look like?

$
0
0

@zzzzBov wrote:

My tendency is to encourage these sorts of requests to be markdown post-processors.

Consider that

>!

produces

<blockquote>
    <p>!</p>
</blockquote>

and that

>! example

produces

<blockquote>
    <p>! example</p>
</blockquote>

a post-processor can simply look for blockquote > p:first-child and test that the text begins with ! to apply spoiler markup.

The advantage to post-processors is that they can be easily configured to suit individual needs. Want to change the spoiler class? Use a config option. Want to change the wrapping code? Use a config option.

Read full topic


Viewing all articles
Browse latest Browse all 38

Trending Articles