Search code examples
htmlw3c

SortSite Text Not Allowed message


I am using SortSite to check my website for accessibility. I have one error I just cannot clear and I was hoping to get more eyes on it to see if anyone can tell me what is wrong... the error only says Text Not Allowed... anyone have any thoughts? Thanks!

<ul>
  <li><span class="obscure" id="Communicating+With+Young+Children_category">Communicating With Young Children</span><a href="p_module_categories.php?id_division=d01&amp;id_category=001&amp;id_module=001&amp;page=1" aria-label="Communicating+With+Young+Children_category">Communicating With Young Children</a></li>
  <li><span class="obscure" id="Considering+Parenthood_category">Considering Parenthood</span><a href="p_module_categories.php?id_division=d01&amp;id_category=002&amp;id_module=001&amp;page=1" aria-label="Considering+Parenthood_category">Considering Parenthood</a></li>
  <li><span class="obscure" id="Children%27s+Self-Esteem_category">Children's Self-Esteem</span><a href="p_module_categories.php?id_division=d01&amp;id_category=003&amp;id_module=001&amp;page=1" aria-label="Children%27s+Self-Esteem_category">Children's Self-Esteem</a></li>
</ul>

Solution

  • I just ran your HTML against the HTML 5 validator at html5.validator.nu like this

    <!DOCTYPE html>
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <ul>
      <li><span class="obscure" id="Communicating+With+Young+Children_category">Communicating With Young Children</span><a href="p_module_categories.php?id_division=d01&amp;id_category=001&amp;id_module=001&amp;page=1" aria-label="Communicating+With+Young+Children_category">Communicating With Young Children</a></li>
      <li><span class="obscure" id="Considering+Parenthood_category">Considering Parenthood</span><a href="p_module_categories.php?id_division=d01&amp;id_category=002&amp;id_module=001&amp;page=1" aria-label="Considering+Parenthood_category">Considering Parenthood</a></li>
      <li><span class="obscure" id="Children%27s+Self-Esteem_category">Children's Self-Esteem</span><a href="p_module_categories.php?id_division=d01&amp;id_category=003&amp;id_module=001&amp;page=1" aria-label="Children%27s+Self-Esteem_category">Children's Self-Esteem</a></li>
    </ul>
    </body>
    </html>
    

    Results

    The document is valid HTML5 + ARIA + SVG 1.1 + MathML 2.0

    This leads me to believe that sortSite complains because of the id attribute of your span element is in conflict with the HTML 4 rules.

    HTML 4 specification requires the following for the id attribute.

    ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

    HTML 5 specification only requires that

    The value must not contain any space characters.