# \[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:** [6 نوفمبر 2017، 3: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:** 1\
**Showing post:** 2

<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:** [6 نوفمبر 2017، 5: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.

---

_[View the full topic](https://meta.discourse.org/t/hide-details-button-not-functioning-splitting-text-into-multiple-details/73486)._
