php / phd

PHD
http://doc.php.net/phd
MIT License
76 stars 49 forks source link

Notes and friends generate semantic HTML garbage #157

Open cmb69 opened 1 month ago

cmb69 commented 1 month ago

I've just noticed that <note> (and likely <caution>, <warning>, and <tip>) especially when having a <title> generate semantic HTML garbage HTML. See e.g. https://www.php.net/manual/en/openssl.installation.php.

<note> yields a <blockquote> which is doubtful per se, but the <title> is just a <strong> element. Instead, we should probably generate a <section> (a div might be a first step in the right direction) ideally with a proper heading for the title. Regarding the latter it might be hard to keep a proper heading structure, but even a gap in the headers appears to be better than misusing a <blockquote>, and a title should be a title.

Also, <simpara>s inside the <note> are apparently ignored/collapsed.

jimwins commented 1 month ago

Perhaps <aside> would be appropriate for these. Doesn't make the <title> any easier to handle, though. https://adrianroselli.com/2016/08/there-is-no-document-outline-algorithm.html

cmb69 commented 1 month ago

I've thought about <aside> too, but MDN states:

The <aside> HTML element represents a portion of a document whose content is only indirectly related to the document's main content.

Girgias commented 1 month ago

Surely "just" using a <section> tag for them is the way?