[details] plugin working while editing but not when posted

markdown-it-review

(Nick Winter) #1

See this post. The [details] content shows up even before clicking to expand. While editing, it works.

While editing, it works (see here).

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


(Jeff Atwood) #2

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

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]

(Joshua Rosenfeld) #3

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


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


(Jeff Atwood) #4

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.


(Joshua Rosenfeld) #5

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):

details go here

This text will not be visible until you expand the spoiler.

it also works with blurred text

this is code

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


(Sam Saffron) #6

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


(Jeff Atwood) #7

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

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]

(Jeff Atwood) #8