# \[details\] plugin working while editing but not when posted

**URL:** https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189
**Category:** Bug
**Tags:** markdown-it-review
**Created:** [June 8, 2017, 7:47pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189 "2017-06-08T19:47:19Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Nick\_Winter](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@Nick\_Winter](https://meta.discourse.org/u/Nick_Winter)
#### Post date: [June 8, 2017, 7:47pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/1 "2017-06-08T19:47:19Z")

</div>

See [this post](https://discourse.codecombat.com/t/faq-check-before-posting/1027). The `[details]` content shows up even before clicking to expand. While editing, it works.

While editing, it works (see [here](https://www.dropbox.com/s/mttonpt9d46ji8l/Screenshot%202017-06-08%2012.45.00.png?dl=0)).

Possibly something to do with the multiple types of things we’re putting in the `[details]` block, including `[spoiler]` and a code block?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 8, 2017, 7:58pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/2 "2017-06-08T19:58:56Z")

</div>

You need blank lines above and below the details block. Looks like you need blank lines above and below the code block too. Let me see…

> **details go here**
>
> This text will not be visible until you expand the spoiler.
> 
> it also works with blurred text
> 
> ```plaintext
> this is code
> 
> ```

Like so?

````
[details=details go here]
This text will not be visible until you expand the spoiler.
[spoiler]it also works with blurred text[/spoiler]

```
this is code
```

[/details]

````

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [June 8, 2017, 8:01pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/3 "2017-06-08T20:01:15Z")

</div>

It does need a blank line above the start block and below the end block to work.

> [@Details tag preview doesn't match cooked post](https://meta.discourse.org/t/details-tag-preview-doesnt-match-cooked-post/50386):
>
> Trying to have a details section inside an existing details section. In the preview when composing it appears correctly, but does not work correctly when the post is cooked. [image] This is how it is actually displaying play_button Utilities (10) Raw text: [details=Utilities (10)] \*\*All Utility drives now contain identical tools\*\* - NX (4) - Silver Capless - White mini Sony capless - Black & Blue PNY - Black & White Cruzer slide - Maple (1) - Blue Kingston Swivel - Matlab (3) - Red mini SanDisk…

* * *

> [@Nick\_Winter](#):
>
> While editing, it works.

This seems to be the real bug that everyone is reporting. Details work. But why does the preview render differently than the cooked post?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 8, 2017, 8:04pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/4 "2017-06-08T20:04:41Z")

</div>

No, try it yourself. This is a different issue having to do with the code block inside. I had to add blank lines _near the code block_.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [June 8, 2017, 8:07pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/5 "2017-06-08T20:07:51Z")

</div>

I’m not disagreeing about the blank lines needed. When I remove the blank lines, here’s what the preview looks like (it appears to work):

 ![](https://global.discourse-cdn.com/meta/original/3X/2/2/22808db08dc277434fef0a3eea197b5b24abe573.png)

> **details go here**
>
> This text will not be visible until you expand the spoiler.
> 
> it also works with blurred text
> 
> ```plaintext
> this is code
> 
> ```

However, once posted the cooked post does not match the preview.

---

<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: [June 8, 2017, 10:18pm UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/6 "2017-06-08T22:18:23Z")

</div>

I got #markdown-it-review on this for a reason 😉

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 20, 2017, 9:26am UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/7 "2017-07-20T09:26:01Z")

</div>

Let’s see if this works any better now:

> **details go here**
>
> This text will not be visible until you expand the spoiler.
> 
> it also works with blurred text
> 
> ```plaintext
> this is code
> 
> ```

Yes this seems fine now that we have commonmark @Nick_Winter .

raw

````
[details=details go here]
This text will not be visible until you expand the spoiler.
[spoiler]it also works with blurred text[/spoiler]
```
this is code
```
[/details]

````

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 20, 2017, 9:36am UTC](https://meta.discourse.org/t/details-plugin-working-while-editing-but-not-when-posted/64189/8 "2017-07-20T09:36:04Z")

</div>


