Skip to content

Footnotes markup does not pass HTML5 validation #536

@louh

Description

@louh

The footnotes markup, as generated from html.c, will not pass HTML5 validation because of the following reasons:

Take this sample output from Redcarpet:

<!DOCTYPE html>
<html>
<head>
  <meta charset='utf-8'>
  <title>Redcarpet footnotes markup example.</title>
</head>
<body>

<p>Reference 1<sup id="fnref1"><a href="#fn1" rel="footnote">1</a></sup></p>

<p>Reference 2<sup id="fnref2"><a href="#fn2" rel="footnote">2</a></sup></p>

<div class="footnotes">
<hr>
<ol>

<li id="fn1">
<p>Footnote 1&nbsp;<a href="#fnref1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn2">
<p>Footnote 2&nbsp;<a href="#fnref2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>

</body>
</html>

When I run it through the (X)HTML5 Nu Validator service, I get the following errors:

    Error: Bad value footnote for attribute rel on element a: The string footnote is not a registered keyword.

    From line 9, column 32; to line 9, column 61

    ="fnref1"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fvmg%2Fredcarpet%2Fissues%2F536%23fn1" rel="footnote">1</a><

    Syntax of list of link-type keywords:
        A whitespace-separated list of link types, with no duplicate keywords in the list. Each link type must be listed as allowed on <a> and <area> in the HTML specification, or must be listed as allowed on <a> and <area> on the Microformats wiki, or must be an absolute URL. You can register link types on the Microformats wiki yourself. 

    Error: Bad value footnote for attribute rel on element a: The string footnote is not a registered keyword.

    From line 11, column 32; to line 11, column 61

    ="fnref2"><a href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fvmg%2Fredcarpet%2Fissues%2F536%23fn2" rel="footnote">2</a><

    Syntax of list of link-type keywords:
        A whitespace-separated list of link types, with no duplicate keywords in the list. Each link type must be listed as allowed on <a> and <area> in the HTML specification, or must be listed as allowed on <a> and <area> on the Microformats wiki, or must be an absolute URL. You can register link types on the Microformats wiki yourself. 

    Error: The rev attribute on the a element is obsolete. Use the rel attribute instead, with a term having the opposite meaning.

    From line 18, column 20; to line 18, column 52

    te 1&nbsp;<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fvmg%2Fredcarpet%2Fissues%2F536%23fnref1" rev="footnote">&#8617

    Error: The rev attribute on the a element is obsolete. Use the rel attribute instead, with a term having the opposite meaning.

    From line 22, column 20; to line 22, column 52

    te 2&nbsp;<a href="proxy.php?url=https%3A%2F%2Fgithub.com%2Fvmg%2Fredcarpet%2Fissues%2F536%23fnref2" rev="footnote">&#8617

The W3C Recommendation for Footnotes is simply to have the anchor links, without any rel attribute.

I understand that removing this might possibly break functionality for people who are using the rel and rev attributes for CSS selectors, so I wanted to raise this for discussion. Perhaps using class names (as with the <div class='footnotes'> already generated in Redcarpet output), is more appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions