1

So we have ye olde spoiler:

like so, utilizing >!, as in a blockquote.

Ah. But you want a fancy spoiler. We can do that too, by using pre html tags.

Lookee here!

This is fancy. Look at that spacing.
 - You want bullets?
 - You can have bullets.

 Just use a "pre" tag inside the spoiler tag.

But suppose you want a spoiler that is both fancy and somewhat lengthy. Is there a way to get it to word-wrap like usual? If you don't use the html tags, you lose the ability to have fancy formatting but if you do use them you lose word wrap:

This here is another fancy-pants spoiler.

 - You can tell it's fancy because of spacing and bullets.

 But if I want to say something really long here and really you don't have to read the rest of the sentence because I'm just typing something sufficiently long to create the horizontal scroll bar that I feel ruins the entire effect and makes me sad.

 Look at this awful horizontal scroll bar:

I'm mostly just curious if there is a further trick allow fancy formatting, as with pre while at the same time employ normal wrap wrap, as without pre.

4
  • 8
    Please don't use code ("pre" tag) formatting for non-code. When I'm reading it visually (especially on mobile), it's very hard to read since everything is on the same line (or manually wrapped at weird places). Also, those aren't bullets. When I use my screen reader, it ignores those hyphens completely. Other settings for screen readers can make it so every character in the code block is spoken out loud.
    – Laurel
    Commented Feb 28, 2023 at 19:25
  • @Laurel Ohh, good to know. Also interesting is that the final statement formats just fine if I replace "spoiler" with "blockquote". It gets all the formatting, and the word wrapping, without needing "pre" tags. Maybe my support request is really a bugfix request: spoiler should work like blockquote?
    – JamieB
    Commented Feb 28, 2023 at 19:28
  • 1
    @SonictheAnonymousHedgehog Sorta -- Makeyn's answer is more direct, as my main problem was the word wrapping, which the linked question didn't mention, but ultimately the answer is the same: don't use "pre", but do use other html tags.
    – JamieB
    Commented Feb 28, 2023 at 20:07
  • Does this answer your question? Markdown not appropriately rendering unordered list spoilers and meta.stackexchange.com/a/217780/282094
    – Rob
    Commented Feb 28, 2023 at 23:25

1 Answer 1

4

There's no need to use the <pre> tag for what you're doing. You can just construct it using the HTML you desire appropriately.

Lookee here!

This is fancy. Look at that spacing.

  • You want bullets?
  • You can have bullets.

There's no need to use a <pre> tag for this formatting. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap.

That's written as:

>! <p>Lookee here!</p>
>! <p>This is fancy. Look at that spacing.</p>
>! <ul><li>You want bullets?</li>
>! <li>You can have bullets.</li></ul>
>! 
>! <p>There's no need to use a `<pre>` tag for this formatting. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap. It will even word wrap.</p>
1
  • 2
    Excellent. I was unaware of these other html tags. I had found an answer that talked about using pre, and exercised that option, but now I realize it can do a lot more than that (I am not an html coder, but I did stay at a Holiday Inn once.)
    – JamieB
    Commented Feb 28, 2023 at 20:01

Not the answer you're looking for? Browse other questions tagged .