# Spoiler with text on the same line as the tag no longer works

**URL:** https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456
**Category:** Support
**Created:** [19. Juli 2017 um 18:49 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456 "2017-07-19T18:49:24Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 18:49 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/1 "2017-07-19T18:49:24Z")

</div>

It used to be possible to conceal multiple spoiler lines like this:

[spoiler]Darth is Anakin

Rosebud is a sled

Everybody dies[/spoiler]

But this no longer works.

You can still do a mid-line spoiler like this but multi-line spoilers require the [spoiler] tag to appear on a line by itself.

```
[spoiler]
multi
line
spoiler
[/spoiler]

```

Can we get the old behavior back?

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 18:51 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/2 "2017-07-19T18:51:54Z")

</div>

The behavior of [quote] seems to have changed as well.

> [@](#):
>
> This should be a quotation, but it isn’t.

BBCode quotations now have to include [quote] on a line by itself, which is annoying.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [19. Juli 2017 um 18:57 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/3 "2017-07-19T18:57:48Z")

</div>

> [@dfabulich](#):
>
> The behavior of [quote] seems to have changed as well.
> 
> > [@](#):
> >
> > This should be a quotation, but it isn’t.
> 
> BBCode quotations now have to include [quote] on a line by itself, which is annoying.

BBCode for quote is only block, no more inline now.

> [@dfabulich](#):
>
> It used to be possible to conceal multiple spoiler lines like this:

```plaintext
[spoiler]
This still works?
[/spoiler]

```

This still works?

On the block syntax you need a line break, you can’t mix inline and block.

The discussion is here:

> [@CommonMark testing started here!](https://meta.discourse.org/t/commonmark-testing-started-here/65121):
>
> Per our [migration plans](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon), I just enabled [markdown.it](https://github.com/markdown-it/markdown-it) at Meta. It is an excellent [CommonMark](http://commonmark.org/) compliant engine. I expect quite a few edges to be found during this period of testing. Do not open bugs about the new Engine, just reply here. I/we will be updating the top post here with the list of issues and striking out stuff as it is fixed. Current known issues (to be fixed)white_check_mark Onebox vanishes after you start typing and works not-super consistently white_check_mark pending…

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 19:10 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/4 "2017-07-19T19:10:22Z")

</div>

This seems like the key post talking about this issue:

> [@Discourse CommonMark migration plans confetti\_ball balloon](https://meta.discourse.org/t/discourse-commonmark-migration-plans-confetti-ball-balloon/64234/6):
>
> Inline multiline quote[quote]that  
> spans  
> lines
> 
> and blocks
> 
> [/quote]Is a terrible format should not be supported

I think I agree with that for [quote], because [quote] affects the entire block of text; it’s nonsensical to start a quote in the middle of a non-quote line.

But there’s nothing terrible about that for [spoiler]. An exception should be made for inline multi-line spoilers.

There already appears to be some special case code. Consider these examples:

```plaintext
[spoiler]spoiler text[/spoiler]
[quote]quote text[/quote]

```

These behave totally differently. The spoiler works, but the quote doesn’t.

spoiler text

> [@](#):
>
> quote text

P.S. I don’t really care about [quote] but I think that last [quote] example should work, too.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19. Juli 2017 um 19:24 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/5 "2017-07-19T19:24:00Z")

</div>

`[spoiler]` is an inline / block level element

`[quote]` is block only

What I eliminated was “mixed” mode.

What about this text:

```plaintext
I **think this should be bold

but it is not**

```

Which render as expected when you remove the newline?

```plaintext
I **think this should be bold
but it is not**

```

Supporting mid-sentence multiline `[spoiler]` is at odds with CommonMark philosophy. No other CommonMark syntax operates like that.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 19:26 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/6 "2017-07-19T19:26:14Z")

</div>

I think you’ll find that **HTML**

 

**operates like that** , and HTML is part of CommonMark; we should think of BBCode as more like HTML than like CommonMark asterisks and underscores.

If it were a \<spoiler\> tag, there would be no question that it should span multiple paragraphs.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19. Juli 2017 um 19:28 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/7 "2017-07-19T19:28:34Z")

</div>

> [@dfabulich](#):
>
> operates like that, and HTML is part of CommonMark; we should think of BBCode as more like HTML than like CommonMark asterisks and underscores.

Sort of, but the spec is creates broken HTML which we normalize

```plaintext
This <b>is bold

and this is only bold in preview</b>

```

This **is bold**

 

**and this is only bold in preview**

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 19:32 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/8 "2017-07-19T19:32:24Z")

</div>

I’ve filed a separate bug about the preview. The editor and the post result should never differ in that way, right?

“Broken HTML” is a rather philosophical idea. The HTML5 parsing spec explains in detail how user agents are supposed to render unbalanced tags like this: `<b>bold <i>bold italic</b> italic</i>`

It’s supposed to render like this: **bold _bold italic_** _italic_. “Normalizing” the HTML by ending the \</b\> without reopening the \<i\> is not correct behavior for HTML. I claim that it’s not what HTML users would expect it to do, nor is it desirable.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19. Juli 2017 um 19:34 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/9 "2017-07-19T19:34:04Z")

</div>

Broken HTML is:

```plaintext
<p>test <b>test</p>
<p>test </b></p>

```

There is nothing philosophical about what is broken there, run it via a validator.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 19:35 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/10 "2017-07-19T19:35:13Z")

</div>

The validator will tell me that it’s invalid, and the spec makes it clear how it should render: the second paragraph should be bolded. This is what it means to be HTML; it’s specified behavior in response to invalid HTML.

More generally, the HTML parsing spec makes it clear that invalid HTML _isn’t_ “broken.” It’s “invalid,” but it has a specified rendering output, and Discourse is not following it for `<b>` tags. Despite that, Discourse _should_ follow that for `<b>` tags, and it should use the same behavior for BBCode.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 19:39 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/11 "2017-07-19T19:39:22Z")

</div>

For comparison, consider XML. XML’s specified behavior is to render nothing when the document contains unbalanced tags. Unbalanced XML tags are _broken_.

Unbalanced HTML tags render exactly the same way in all browsers. Unbalanced HTML tags are “invalid” but _not_ broken.

P.S. I’ve discovered that I can use `<blockquote>` instead of `[quote]` and get back great-looking one-line quotations.

```markdown
[quote]this is broken[/quote]
<blockquote>but this works great</blockquote>

```

> [@](#):
>
> this is broken

> but this works great

But I still don’t really care about [quote]. I care about spoilers.

---

<div class="post-metadata">

### Author: ![dfabulich](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dfabulich/32/108716_2.png) [@dfabulich](https://meta.discourse.org/u/dfabulich)
#### Post date: [19. Juli 2017 um 20:59 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/12 "2017-07-19T20:59:44Z")

</div>

This conversation about misnested tags has kinda moved to the other thread. (Including a workaround for nokogiri’s busted HTML parser.)

[https://meta.discourse.org/t/html-b-across-paragraph-breaks-differs-between-preview-and-result/66458/5?u=dfabulich](https://meta.discourse.org/t/html-b-across-paragraph-breaks-differs-between-preview-and-result/66458/5)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [1. Juli 2019 um 20:36 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/13 "2019-07-01T20:36:54Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [21. Dezember 2022 um 22:08 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/14 "2022-12-21T22:08:53Z")

</div>



---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [21. Dezember 2022 um 22:34 UTC](https://meta.discourse.org/t/spoiler-with-text-on-the-same-line-as-the-tag-no-longer-works/66456/15 "2022-12-21T22:34:45Z")

</div>


