TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.59k stars 2.06k forks source link

Bug: Markdown preview tool does not render dropdowns and summaries #4488

Closed MaoShizhong closed 3 months ago

MaoShizhong commented 3 months ago

Checks

Bug description

Collapsibles are handled in our lesson md files via

<details markdown="block">

<summary class="dropDown-header">TITLE</summary>

CONTENTS OF COLLAPSIBLE BLOCK

</details>

While these render completely fine on the main website, the same markdown does not render as a collapsible in the markdown preview tool. The result does not render a <details> parent, and the <summary class="dropDown-header">TITLE</summary> is rendered as a plain text node " TITLE " instead.

An example can be found with the Foundations "Setting up Git" lesson.

How to reproduce

  1. Go to the "Setting up Git" lesson md file in the curriculum repo and copy the raw markdown.
  2. Go to the markdown preview tool, paste in the markdown and preview it.
  3. Observe how under Step 1: Install Git, Linux is a plain text node and its contents laid out in full, as opposed to being a collapsible <details> element. The same applies to the following MacOS and ChromeOS sections.
  4. Compare this to the page in production at Setting up Git.

image

Expected behavior

  1. Go to the "Setting up Git" lesson md file in the curriculum repo and copy the raw markdown.
  2. Go to the markdown preview tool, paste in the markdown and preview it.
  3. Linux underneath Step 1: Install Git should be rendered as a <summary> within a collapsed <details> element that can be toggled open/closed. The same should apply for the following MacOS and ChromeOS sections.

image

What browsers are you seeing the problem on?

Firefox, Chrome

What OS are you using?

No response

Discord Name

No response

Additional Comments

No response

CouchofTomato commented 3 months ago

@KevinMulhern can you take a look at this please mate

KevinMulhern commented 3 months ago

Thanks for letting us know @MaoShizhong. This looks to be related to https://github.com/TheOdinProject/theodinproject/pull/4479. I'll get a fix put together.