# Collapsing content on OpenMRS Talk

**URL:** <https://talk.openmrs.org/t/collapsing-content-on-openmrs-talk/24819>\
**Category:** Meta\
**Created:** [September 23, 2019, 4:58pm UTC](https://talk.openmrs.org/t/collapsing-content-on-openmrs-talk/24819 "2019-09-23T16:58:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![burke](https://talk.openmrs.org/user_avatar/talk.openmrs.org/burke/32/17_2.png) [@burke](https://talk.openmrs.org/u/burke)\
**Post date:** [September 23, 2019, 4:58pm UTC](https://talk.openmrs.org/t/collapsing-content-on-openmrs-talk/24819/1 "2019-09-23T16:58:04Z")

</div>

I was looking for a way to collapse code blocks within a Talk post and discovered [this little pearl](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) that works within Discourse posts:

* * *

```
<details>
<summary>Hint to show in post</summary>

```json
Long block of code
goes here
...
```
</details>
```

* * *

is rendered like this:

> **Hint to show in post**
>
> ```json
> Long block of code
> goes here
> ...
> 
> ```

* * *

_TIP:_ The empty line after the `<summary/>` element is needed to properly render the code block. Posts are limited to ~32K, so it’s still best practice to put large chunks of code into a website like [pastebin.com](http://pastebin.com) and link to it.

---

<div class="post-metadata">

**Author:** ![herbert24](https://talk.openmrs.org/user_avatar/talk.openmrs.org/herbert24/32/8178_2.png) [@herbert24](https://talk.openmrs.org/u/herbert24)\
**Post date:** [September 24, 2019, 7:18am UTC](https://talk.openmrs.org/t/collapsing-content-on-openmrs-talk/24819/2 "2019-09-24T07:18:11Z")

</div>

Thanks @burke for sharing this!!

---

<div class="post-metadata">

**Author:** ![mozzy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mozzy/32/11815_2.png) [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Post date:** [September 24, 2019, 7:20am UTC](https://talk.openmrs.org/t/collapsing-content-on-openmrs-talk/24819/3 "2019-09-24T07:20:42Z")

</div>

> **Woow , thanks @burke. its a great tool**
>
> ```json
> It works
> 
> ```
