HTML Details Element

We sometimes have people wanting to add some collapsible web content in a document. While Markdown purists won’t like the approach, I’m not telling anyone how to compose their Markdown. So I comped this snippet together in case it’s useful to anyone…

# popclip
name: HTML Details
icon: circle filled D
javascript: popclip.pasteText("<details><summary>" + popclip.input.text.match(/[^-*•.?!-\d]+/)[0].trim() + "</summary>\n" + popclip.input.text + "\n</details>")
description: Creates HTML details element

It could be used in HTML markup as well.

2 Likes