p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

[list] <ul> and <ol> must only directly contain <li>, <script> or <template> elements

Open coseeian opened this issue 6 months ago • 0 comments

Title

[list] <ul> and <ol> must only directly contain <li>, <script> or <template> elements

Description

The page contains an unordered list (<ul class="content-grid-simple">) that includes direct children which are not <li>, <script>, or <template> elements. This violates the HTML specification and can lead to inconsistent rendering across browsers as well as difficulties for assistive technologies to interpret the list structure correctly.

Steps to Reproduce

  1. Go to /reference/p5/arc/
  2. Locate to the following element: #main-content > div.md:mx-lg.mt-md.mx-5 > div:nth-child(2) > section > ul (This issue is since to be a global issue)

Actual Behavior

The <ul> element contains elements other than <li>, <script>, or <template> as direct children. The <ul> element includes disallowed direct children (e.g., <div>, <p>, etc.) rather than wrapping all content within <li>, <script>, or <template> elements.

Expected Behavior

Ensure all ordered (<ol>) and unordered (<ul>) list elements only have the following elements as direct children:

  • <li>
  • <script>
  • <template> Any other elements should be wrapped appropriately within <li> elements.

Environments

No response

Suggested Fix

Refactor the markup so that all direct children of <ul> or <ol> that are not <li>, <script>, <template> elements are wrapped within <li> elements. For example:

<ul class="content-grid-simple">
  <li><div>Content</div></li>
</ul>

Reference

WCAG:

WCAG-T:

other:

What is your operating system?

None

Web browser and version

No response

coseeian avatar Jun 19 '25 04:06 coseeian