MathJax לא מוצג בתוך \u003cdetails\u003e ללא שורה חדשה אחרי \u003csummary\u003e

סיכום מבוסס בינה מלאכותית

The discussion addresses an issue where MathJax expressions inside <details> HTML tags fail to render unless a newline is placed immediately after the <summary> tag. Ethsim2 reports this behavior, noting it affects both inline and block math and is undocumented. j.jaffeux suggests using the [details] bbcode instead, which avoids the issue. sam clarifies that this is not a bug but a limitation of CommonMark’s handling of mixed HTML and Markdown, making the behavior expected rather than erroneous.

Hi — this is a follow-up to my earlier post:


I’ve identified that MathJax expressions inside <details> blocks do not render unless a newline is inserted immediately after the <summary> tag.


Minimal reproduction:

This does not render:

<details><summary>Example</summary>
$$
x^2 + y^2 = z^2
$$
</details>

This does render:

<details><summary>Example</summary>

$$
x^2 + y^2 = z^2
$$
</details>

Notes:

  • This behavior is unintuitive and undocumented.
  • It affects both inline and block MathJax.
  • ChatGPT tells me it “Tested on Discourse 3.2.0beta3 with default settings”.

Could this be made more robust or documented somewhere for users relying on math formatting?

יכולתי לתקן את זה אבל לא הייתה לך הבעיה הזו אם היית משתמש בבלוק פרטים:

[details="test"]
$$
x^2 + y^2 = z^2
$$
[/details]

אה, אני חושב שעדיף לא לתקן את הנושא הזה אז

כן, זו לא באג, זו מגבלה/עיצוב של CommonMark

ערבוב HTML ו-Markdown כולל כמה כללים ספציפיים למדי ומפתיעים למדי.