jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
6.82k stars 2.47k forks source link

fix(callouts): When there are two or more nested callouts, the max-height of the parent callout may be incorrect when expanded. #1233

Open SockingPanda opened 3 months ago

SockingPanda commented 3 months ago

(Official website example)[https://quartz.jzhao.xyz/features/callouts#:~:text=Yes!%2C%20they%20can.%20And%20collapsed!] When clicking "Can callouts be nested?" twice and then clicking on its child callout, the max-height of [!question] does not change correctly. (I also tested this locally, and it's the same.)

[!question]+ Can callouts be nested?

[!todo]+ Callouts1

[!example]- Callouts2 You can even use multiple layers of nesting.

Reason: After a child callout is interacted with, it will traverse up the entire callout tree from the current callout being operated on to update the max-height of all parent callouts, but it fails to traverse correctly. The child callout is located one level below the callout-content, not directly below the callout.