Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Post History
When using a <details> tag to add an expandable section to a post, markdown will mostly still work inside the expandable section, but some of it will not work on the first line. Markdown trea...
#1: Initial revision
Details tag requires an internal blank line to render markdown
When using a `<details>` tag to add an expandable section to a post, markdown will mostly still work inside the expandable section, but some of it will not work on the first line. Markdown treats multiple lines as a single line for rendering unless separated by a blank line or a trailing pair of spaces. This means that the failure to render can happen even if there is apparently no markdown syntax in the first line, which can exacerbate the confusion. This can be worked around by the user by adding an initial blank line inside the `<details>` tag. Could this be automated, so that every `<details>` tag has an initial blank line added before the markdown is processed? Adding initial blank lines inside the `<details>` tag has no other effect, as the blank lines are ignored when rendering markdown: ```text <details><summary>Example with many initial blank lines</summary> Example wording. </details> ``` renders without the initial blank lines: <details><summary>Example with many initial blank lines</summary> Example wording. </details> # Examples of broken markdown with and without the workaround ## Code blocks with triple back ticks ````text <details><summary>Without an initial blank line</summary> Word ``` code ``` </details> ```` renders as: <details><summary>Without an initial blank line</summary> Word ``` code ``` </details> ````text <details><summary>With an initial blank line</summary> Word ``` code ``` </details> ```` renders as: <details><summary>With an initial blank line</summary> Word ``` code ``` </details> ## Headings ```text <details><summary>Without an initial blank line</summary> Word ###### Heading Word </details> ``` renders as: <details><summary>Without an initial blank line</summary> Word ###### Heading Word </details> ```text <details><summary>With an initial blank line</summary> Word ###### Heading Word </details> ``` renders as: <details><summary>With an initial blank line</summary> Word ###### Heading Word </details> ## Inline code ```text <details><summary>Without an initial blank line</summary> A sentence with `code` in it. </details> ``` renders as: <details><summary>Without an initial blank line</summary> A sentence with `code` in it. </details> ```text <details><summary>With an initial blank line</summary> A sentence with `code` in it. </details> ``` renders as: <details><summary>With an initial blank line</summary> A sentence with `code` in it. </details> ## Bullet points (unordered lists) ```text <details><summary>Without an initial blank line</summary> - one - two - three </details> ``` renders as: <details><summary>Without an initial blank line</summary> - one - two - three </details> ```text <details><summary>With an initial blank line</summary> - one - two - three </details> ``` renders as: <details><summary>With an initial blank line</summary> - one - two - three </details> ## Numbered lists (ordered lists) ```text <details><summary>Without an initial blank line</summary> 1. one 1. two 1. three </details> ``` renders as: <details><summary>Without an initial blank line</summary> 1. one 1. two 1. three </details> ```text <details><summary>With an initial blank line</summary> 1. one 1. two 1. three </details> ``` renders as: <details><summary>With an initial blank line</summary> 1. one 1. two 1. three </details> ## Quote blocks ```text <details><summary>Without an initial blank line</summary> > one > > two > > three </details> ``` renders as: <details><summary>Without an initial blank line</summary> > one > > two > > three </details> ```text <details><summary>With an initial blank line</summary> > one > > two > > three </details> ``` renders as: <details><summary>With an initial blank line</summary> > one > > two > > three </details> ## Bold and italics ```text <details><summary>Without an initial blank line</summary> It was a *dark* **stormy** night ***long*** ago </details> ``` renders as: <details><summary>Without an initial blank line</summary> It was a *dark* **stormy** night ***long*** ago </details> ```text <details><summary>With an initial blank line</summary> It was a *dark* **stormy** night ***long*** ago </details> ``` renders as: <details><summary>With an initial blank line</summary> It was a *dark* **stormy** night ***long*** ago </details>