Skip to content

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

Open
@coseeian

Description

@coseeian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Accessibility: Low SeverityMinor impact or no clear violation of a11y guidelines, but still a negative experienceGood First IssueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions