# \[Hide Details\] Button not functioning: splitting text into multiple details!

**URL:** https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486
**Category:** Bug
**Tags:** hide-details
**Created:** [2017年十一月6日 03:47 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486 "2017-11-06T03:47:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AnimeCanuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/animecanuck/32/75200_2.png) [@AnimeCanuck](https://meta.discourse.org/u/AnimeCanuck)
#### Post date: [2017年十一月6日 03:47 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486/1 "2017-11-06T03:47:06Z")

</div>

Hi, I’m not a host but rather a user of the WaniKani forums, and since this was not a bug for them, I thought I wouldn’t pester Viet. Any Details-related bugs that came up in the search were locked.

So first of all, writing the Details tag manually around the text does not seem to be working. So then I thought I was typing it incorrectly/didn’t leave enough spaces before/after my text.  
So I tried using the button under the GEAR button to add details to selected text:

This _used_ to function normally as desired, and then you could replace “Summary” with whatever title your heart desired. However [over here at this post](https://community.wanikani.com/t/pass-the-haiku-a-forum-game/12141/466) the button instead applied the details tag around every separate line of text. Seeing this in my text box, I didn’t even bother to edit my post, but instead came here to report it. I shall try to recreate it here as an example, because it is _very_ odd behaviour.

> **Summary**
>
> Hello, this is a block of text.

> **Summary**
>
> It has multiple lines, because I like the enter key.

> **Summary**
>
> Doesn’t everyone?

> **Summary**
>
> Extra text to prove my point.

EDIT: That was a small four-line paragraph with enters between each line. And that’s what the Details Button did to my text. Point proven. Very easy to replicate. Not just a problem at [community.wanikani.com](http://community.wanikani.com).

Anyone else having this issue?

---

<div class="post-metadata">

### Author: ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)
#### Post date: [2017年十一月6日 05:02 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486/2 "2017-11-06T05:02:58Z")

</div>

Reproduced this on meta:

```plaintext
// If the editor contains the following text
first line
second line

// Selecting them and clicking the `Hide Details` button would produce:
[details="Summary"]
first line
[/details]

[details="Summary"]
second line
[/details]

// While the desired behaviour should produce:
[details="Summary"]
first line
second line
[/details]

```

Took the liberty to fix it and added a test:

[https://github.com/discourse/discourse/pull/5290](https://github.com/discourse/discourse/pull/5290)

* * *

P.S. I did notice [@sam’s previous commit](https://github.com/discourse/discourse/commit/c1560d8195f40dc048b8ad605ef8a67a516c64d6#diff-4d2812bfbfa25e51a1a2593493d065b3), but I believe the `{ multiline: true }` change was unintentional.

---

<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: [2017年十一月6日 05:23 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486/3 "2017-11-06T05:23:14Z")

</div>

Hmm is this a regression @sam?

---

<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: [2017年十一月6日 07:02 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486/4 "2017-11-06T07:02:33Z")

</div>

I guess it is … looks like it.

---

<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: [2017年十一月8日 02:00 UTC](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486/5 "2017-11-08T02:00:10Z")

</div>

This topic was automatically closed after 41 hours. New replies are no longer allowed.
