question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Collapsible sections - summary/ details don't render details properly.

See original GitHub issue

Trying to use the collapsible details section as per this thread. https://github.com/dear-github/dear-github/issues/166

Works correctly to give a collapsible section, but the markdown within the details tag fails to render properly (eg italics, bold etc… fail to render).

eg try with:

`
stuff with mark down

formatted heading with a

{{stamdard 3-backtick code block omitted from here due to escaping issues}} Collapsible until here.

`

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
TheBoxyBearcommented, Jul 18, 2021

I’m looking to replicate what OP did by making the header itself collapsible. Tried getting the raw text by generating a quote reply but it doesn’t seem to work. Could @yunti please provide the content of their original comment in a code block?

0reactions
vschcommented, Apr 18, 2017

@QueenBeeSC, GitHub syntax for headings requires a space between the last # and the heading text and it must be on a line by itself.

As for not processing Markdown in block HTML, it is a limitation of GitHub. One way to get around it is to force the <details> tag to be processed as inline HTML by prefixing it with some text, at least &nbsp so that the block is parsed as a paragraph instead of an HTML block. You also need to make sure the HTML open/close tags are balanced.

&nbsp;<details><summary>Collapsed Text</summary>When I try to add the hashtags inside
&nbsp;<details><summary>Hidden Heading</summary>
## New User
&nbsp;</details></details>

Will give you:

 

Collapsed TextWhen I try to add the hashtags inside  
Hidden Heading

New User

 

Read more comments on GitHub >

github_iconTop Results From Across the Web

Make <details>/<summary> folding more discoverable - GitLab
Ideas for how to make this more discoverable. Automatically suggest using <details>/<summary> when the text area reaches a large number of ...
Read more >
Collapsible items | Dev Cheatsheets - Michael Currin
In Markdown, how to create sections which can expand and collapse again like an accordion. Format. Here we use the details and summary...
Read more >
Collapsible Sections With or Without JavaScript
Whilst HTML 5 did give us the <details> and <summary> tags for collapsible sections, it is often just the wrong code from a...
Read more >
Rmarkdown is not displaying collapsible panels correctly
Once you remove all </details> closing tags, problem would be solved. It seems to be Markdown issue failing to render <details><summary>.
Read more >
The details and summary elements, again | scottohara.me
Browsers will render the <summary> as the first element anyway, mitigating one's inability to follow very simple markup instructions. Styling a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found