LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.25k stars 880 forks source link

Support markdown sub/superscript, use external crate for spoilers #5135

Closed Nutomic closed 2 weeks ago

Nutomic commented 2 weeks ago

@SleeplessOne1917 The test for spoilers is failing, its not generating the <p> tag: Expected: <details><summary>click to see more</summary><p>how spicy!</p></details> Actual: <details><summary>click to see more</summary>how spicy!</details>

SleeplessOne1917 commented 2 weeks ago

The omission of the <p> tag inside the <details> is deliberate as it doesn't affect how it's displayed and, in some cases (e.g. block quotes, tables, horizontal rules) can lead to tags ending up as children of <p> tags when it doesn't semantically make sense. That said, the fact that the markdown parsing is used on user created content makes worrying about semantic HTML an uphill battle to the point where compromises are unavoidable and maybe even desireable.

If you think it's important enough to add the <p> tag, I can make the change.

Nutomic commented 2 weeks ago

Alright I trust you because my knowledge of html is very basic, so I fixed the test.