Skip to content

Commit 55d61fa

Browse files
authored
Merge pull request #433 from IainHaslam/master
Fix HTML5 by removing rel="footnote" which is invalid.
2 parents 8db9055 + 338ca35 commit 55d61fa

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

html.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ func (options *Html) FootnoteRef(out *bytes.Buffer, ref []byte, id int) {
620620
out.WriteString(`fnref:`)
621621
out.WriteString(options.parameters.FootnoteAnchorPrefix)
622622
out.Write(slug)
623-
out.WriteString(`"><a rel="footnote" href="#`)
623+
out.WriteString(`"><a href="#`)
624624
out.WriteString(`fn:`)
625625
out.WriteString(options.parameters.FootnoteAnchorPrefix)
626626
out.Write(slug)

inline_test.go

+22-22
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ func TestAutoLink(t *testing.T) {
853853

854854
var footnoteTests = []string{
855855
"testing footnotes.[^a]\n\n[^a]: This is the note\n",
856-
`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup></p>
856+
`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a href="#fn:a">1</a></sup></p>
857857
<div class="footnotes">
858858
859859
<hr />
@@ -877,7 +877,7 @@ var footnoteTests = []string{
877877
878878
No longer in the footnote
879879
`,
880-
`<p>testing long<sup class="footnote-ref" id="fnref:b"><a rel="footnote" href="#fn:b">1</a></sup> notes.</p>
880+
`<p>testing long<sup class="footnote-ref" id="fnref:b"><a href="#fn:b">1</a></sup> notes.</p>
881881
882882
<p>No longer in the footnote</p>
883883
<div class="footnotes">
@@ -913,7 +913,7 @@ what happens here
913913
[note]: /link/c
914914
915915
`,
916-
`<p>testing<sup class="footnote-ref" id="fnref:c"><a rel="footnote" href="#fn:c">1</a></sup> multiple<sup class="footnote-ref" id="fnref:d"><a rel="footnote" href="#fn:d">2</a></sup> notes.</p>
916+
`<p>testing<sup class="footnote-ref" id="fnref:c"><a href="#fn:c">1</a></sup> multiple<sup class="footnote-ref" id="fnref:d"><a href="#fn:d">2</a></sup> notes.</p>
917917
918918
<p>omg</p>
919919
@@ -932,7 +932,7 @@ what happens here
932932
`,
933933

934934
"testing inline^[this is the note] notes.\n",
935-
`<p>testing inline<sup class="footnote-ref" id="fnref:this-is-the-note"><a rel="footnote" href="#fn:this-is-the-note">1</a></sup> notes.</p>
935+
`<p>testing inline<sup class="footnote-ref" id="fnref:this-is-the-note"><a href="#fn:this-is-the-note">1</a></sup> notes.</p>
936936
<div class="footnotes">
937937
938938
<hr />
@@ -944,7 +944,7 @@ what happens here
944944
`,
945945

946946
"testing multiple[^1] types^[inline note] of notes[^2]\n\n[^2]: the second deferred note\n[^1]: the first deferred note\n\n\twhich happens to be a block\n",
947-
`<p>testing multiple<sup class="footnote-ref" id="fnref:1"><a rel="footnote" href="#fn:1">1</a></sup> types<sup class="footnote-ref" id="fnref:inline-note"><a rel="footnote" href="#fn:inline-note">2</a></sup> of notes<sup class="footnote-ref" id="fnref:2"><a rel="footnote" href="#fn:2">3</a></sup></p>
947+
`<p>testing multiple<sup class="footnote-ref" id="fnref:1"><a href="#fn:1">1</a></sup> types<sup class="footnote-ref" id="fnref:inline-note"><a href="#fn:inline-note">2</a></sup> of notes<sup class="footnote-ref" id="fnref:2"><a href="#fn:2">3</a></sup></p>
948948
<div class="footnotes">
949949
950950
<hr />
@@ -967,7 +967,7 @@ what happens here
967967
968968
may be multiple paragraphs.
969969
`,
970-
`<p>This is a footnote<sup class="footnote-ref" id="fnref:1"><a rel="footnote" href="#fn:1">1</a></sup><sup class="footnote-ref" id="fnref:and-this-is-an-i"><a rel="footnote" href="#fn:and-this-is-an-i">2</a></sup></p>
970+
`<p>This is a footnote<sup class="footnote-ref" id="fnref:1"><a href="#fn:1">1</a></sup><sup class="footnote-ref" id="fnref:and-this-is-an-i"><a href="#fn:and-this-is-an-i">2</a></sup></p>
971971
<div class="footnotes">
972972
973973
<hr />
@@ -983,21 +983,21 @@ what happens here
983983
`,
984984

985985
"empty footnote[^]\n\n[^]: fn text",
986-
"<p>empty footnote<sup class=\"footnote-ref\" id=\"fnref:\"><a rel=\"footnote\" href=\"#fn:\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:\">fn text\n</li>\n</ol>\n</div>\n",
986+
"<p>empty footnote<sup class=\"footnote-ref\" id=\"fnref:\"><a href=\"#fn:\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:\">fn text\n</li>\n</ol>\n</div>\n",
987987

988988
"Some text.[^note1]\n\n[^note1]: fn1",
989-
"<p>Some text.<sup class=\"footnote-ref\" id=\"fnref:note1\"><a rel=\"footnote\" href=\"#fn:note1\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:note1\">fn1\n</li>\n</ol>\n</div>\n",
989+
"<p>Some text.<sup class=\"footnote-ref\" id=\"fnref:note1\"><a href=\"#fn:note1\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:note1\">fn1\n</li>\n</ol>\n</div>\n",
990990

991991
"Some text.[^note1][^note2]\n\n[^note1]: fn1\n[^note2]: fn2\n",
992-
"<p>Some text.<sup class=\"footnote-ref\" id=\"fnref:note1\"><a rel=\"footnote\" href=\"#fn:note1\">1</a></sup><sup class=\"footnote-ref\" id=\"fnref:note2\"><a rel=\"footnote\" href=\"#fn:note2\">2</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:note1\">fn1\n</li>\n<li id=\"fn:note2\">fn2\n</li>\n</ol>\n</div>\n",
992+
"<p>Some text.<sup class=\"footnote-ref\" id=\"fnref:note1\"><a href=\"#fn:note1\">1</a></sup><sup class=\"footnote-ref\" id=\"fnref:note2\"><a href=\"#fn:note2\">2</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:note1\">fn1\n</li>\n<li id=\"fn:note2\">fn2\n</li>\n</ol>\n</div>\n",
993993

994994
`Bla bla [^1] [WWW][w3]
995995
996996
[^1]: This is a footnote
997997
998998
[w3]: http://www.w3.org/
999999
`,
1000-
`<p>Bla bla <sup class="footnote-ref" id="fnref:1"><a rel="footnote" href="#fn:1">1</a></sup> <a href="http://www.w3.org/">WWW</a></p>
1000+
`<p>Bla bla <sup class="footnote-ref" id="fnref:1"><a href="#fn:1">1</a></sup> <a href="http://www.w3.org/">WWW</a></p>
10011001
<div class="footnotes">
10021002
10031003
<hr />
@@ -1013,7 +1013,7 @@ what happens here
10131013
10141014
[^fn1]: Fine print
10151015
`,
1016-
`<p>This is exciting!<sup class="footnote-ref" id="fnref:fn1"><a rel="footnote" href="#fn:fn1">1</a></sup></p>
1016+
`<p>This is exciting!<sup class="footnote-ref" id="fnref:fn1"><a href="#fn:fn1">1</a></sup></p>
10171017
<div class="footnotes">
10181018
10191019
<hr />
@@ -1031,17 +1031,17 @@ test footnotes the second.[^b]
10311031
[^a]: This is the first note[^a].
10321032
[^b]: this is the second note.[^a]
10331033
`,
1034-
`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup></p>
1034+
`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a href="#fn:a">1</a></sup></p>
10351035
1036-
<p>test footnotes the second.<sup class="footnote-ref" id="fnref:b"><a rel="footnote" href="#fn:b">2</a></sup></p>
1036+
<p>test footnotes the second.<sup class="footnote-ref" id="fnref:b"><a href="#fn:b">2</a></sup></p>
10371037
<div class="footnotes">
10381038
10391039
<hr />
10401040
10411041
<ol>
1042-
<li id="fn:a">This is the first note<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup>.
1042+
<li id="fn:a">This is the first note<sup class="footnote-ref" id="fnref:a"><a href="#fn:a">1</a></sup>.
10431043
</li>
1044-
<li id="fn:b">this is the second note.<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup>
1044+
<li id="fn:b">this is the second note.<sup class="footnote-ref" id="fnref:a"><a href="#fn:a">1</a></sup>
10451045
</li>
10461046
</ol>
10471047
</div>
@@ -1086,13 +1086,13 @@ func TestNestedFootnotes(t *testing.T) {
10861086
10871087
[^fn2]:
10881088
Obelisk`,
1089-
`<p>Paragraph.<sup class="footnote-ref" id="fnref:fn1"><a rel="footnote" href="#fn:fn1">1</a></sup></p>
1089+
`<p>Paragraph.<sup class="footnote-ref" id="fnref:fn1"><a href="#fn:fn1">1</a></sup></p>
10901090
<div class="footnotes">
10911091
10921092
<hr />
10931093
10941094
<ol>
1095-
<li id="fn:fn1">Asterisk<sup class="footnote-ref" id="fnref:fn2"><a rel="footnote" href="#fn:fn2">2</a></sup>
1095+
<li id="fn:fn1">Asterisk<sup class="footnote-ref" id="fnref:fn2"><a href="#fn:fn2">2</a></sup>
10961096
</li>
10971097
<li id="fn:fn2">Obelisk
10981098
</li>
@@ -1110,19 +1110,19 @@ This uses footnote C.[^C]
11101110
[^C]:
11111111
C note, uses B.[^B]
11121112
`,
1113-
`<p>This uses footnote A.<sup class="footnote-ref" id="fnref:A"><a rel="footnote" href="#fn:A">1</a></sup></p>
1113+
`<p>This uses footnote A.<sup class="footnote-ref" id="fnref:A"><a href="#fn:A">1</a></sup></p>
11141114
1115-
<p>This uses footnote C.<sup class="footnote-ref" id="fnref:C"><a rel="footnote" href="#fn:C">2</a></sup></p>
1115+
<p>This uses footnote C.<sup class="footnote-ref" id="fnref:C"><a href="#fn:C">2</a></sup></p>
11161116
<div class="footnotes">
11171117
11181118
<hr />
11191119
11201120
<ol>
1121-
<li id="fn:A">A note. use itself.<sup class="footnote-ref" id="fnref:A"><a rel="footnote" href="#fn:A">1</a></sup>
1121+
<li id="fn:A">A note. use itself.<sup class="footnote-ref" id="fnref:A"><a href="#fn:A">1</a></sup>
11221122
</li>
1123-
<li id="fn:C">C note, uses B.<sup class="footnote-ref" id="fnref:B"><a rel="footnote" href="#fn:B">3</a></sup>
1123+
<li id="fn:C">C note, uses B.<sup class="footnote-ref" id="fnref:B"><a href="#fn:B">3</a></sup>
11241124
</li>
1125-
<li id="fn:B">B note, uses A to test duplicate.<sup class="footnote-ref" id="fnref:A"><a rel="footnote" href="#fn:A">1</a></sup>
1125+
<li id="fn:B">B note, uses A to test duplicate.<sup class="footnote-ref" id="fnref:A"><a href="#fn:A">1</a></sup>
11261126
</li>
11271127
</ol>
11281128
</div>

0 commit comments

Comments
 (0)