@@ -90,6 +90,11 @@ title: p6 (strikethrough)
9090title: p7 (emoji)
9191---
9292## A :snake: emoji
93+ -- content/p8.md --
94+ ---
95+ title: p8 (link)
96+ ---
97+ ## A [link](https://example.org)
9398`
9499
95100 b := hugolib .Test (t , files )
@@ -111,36 +116,41 @@ title: p7 (emoji)
111116</nav>` )
112117
113118 // markdown
114- b .AssertFileContent ("public/p2/index.html" , `<nav id="TableOfContents">
115- <li><a href="#">Some <em>emphasized</em> text</a></li>
116- <li><a href="#">Some <code>inline</code> code</a></li>
117- <li><a href="#">Something to escape A < B && C > B</a></li>
118- ` )
119+ b .AssertFileContent ("public/p2/index.html" ,
120+ ` <li><a href="#">Some <em>emphasized</em> text</a></li>` ,
121+ ` <li><a href="#">Some <code>inline</code> code</a></li>` ,
122+ ` <li><a href="#">Something to escape A < B && C > B</a></li>` ,
123+ )
119124
120125 // image
121- b .AssertFileContent ("public/p3/index.html" , `
122- <li><a href="#">An image <img src="a.jpg" alt="kitten"></a></li>
123- ` )
126+ b .AssertFileContent ("public/p3/index.html" ,
127+ ` <li><a href="#">An image <img src="a.jpg" alt="kitten"></a></li>` ,
128+ )
124129
125130 // raw html
126- b .AssertFileContent ("public/p4/index.html" , `
127- <li><a href="#">Some <!-- raw HTML omitted -->raw<!-- raw HTML omitted --> HTML< /a></li>
128- ` )
131+ b .AssertFileContent ("public/p4/index.html" ,
132+ ` <li><a href="#">Some raw HTML< /a></li>` ,
133+ )
129134
130135 // typographer
131- b .AssertFileContent ("public/p5/index.html" , `
132- <li><a href="#">Some "typographer" markup</a></li>
133- ` )
136+ b .AssertFileContent ("public/p5/index.html" ,
137+ ` <li><a href="#">Some "typographer" markup</a></li>` ,
138+ )
134139
135140 // strikethrough
136- b .AssertFileContent ("public/p6/index.html" , `
137- <li><a href="#">Some ~~deleted~~ text</a></li>
138- ` )
141+ b .AssertFileContent ("public/p6/index.html" ,
142+ ` <li><a href="#">Some ~~deleted~~ text</a></li>` ,
143+ )
139144
140145 // emoji
141- b .AssertFileContent ("public/p7/index.html" , `
142- <li><a href="#">A :snake: emoji</a></li>
143- ` )
146+ b .AssertFileContent ("public/p7/index.html" ,
147+ `<li><a href="#">A :snake: emoji</a></li>` ,
148+ )
149+
150+ // link
151+ b .AssertFileContent ("public/p8/index.html" ,
152+ `<li><a href="#">A link</a></li>` ,
153+ )
144154}
145155
146156func TestTableOfContentsAdvanced (t * testing.T ) {
@@ -214,6 +224,11 @@ title: p6 (strikethrough)
214224title: p7 (emoji)
215225---
216226## A :snake: emoji
227+ -- content/p8.md --
228+ ---
229+ title: p8 (link)
230+ ---
231+ ## A [link](https://example.org)
217232`
218233
219234 b := hugolib .Test (t , files )
@@ -231,37 +246,41 @@ title: p7 (emoji)
231246</nav>` )
232247
233248 // markdown
234- b .AssertFileContent ("public/p2/index.html" , `<nav id="TableOfContents">
235- <li><a href="#some-emphasized-text">Some <em>emphasized</em> text</a></li>
236- <li><a href="#some-inline-code">Some <code>inline</code> code</a></li>
237- <li><a href="#something-to-escape-a--b--c--b">Something to escape A < B && C > B</a></li>
238- ` )
249+ b .AssertFileContent ("public/p2/index.html" ,
250+ ` <li><a href="#some-emphasized-text">Some <em>emphasized</em> text</a></li>` ,
251+ ` <li><a href="#some-inline-code">Some <code>inline</code> code</a></li>` ,
252+ ` <li><a href="#something-to-escape-a--b--c--b">Something to escape A < B && C > B</a></li>` ,
253+ )
239254
240255 // image
241- b .AssertFileContent ("public/p3/index.html" , `
242- <li><a href="#an-image-kitten">An image <img src="a.jpg" alt="kitten" /></a></li>
243- ` )
256+ b .AssertFileContent ("public/p3/index.html" ,
257+ ` <li><a href="#an-image-kitten">An image <img src="a.jpg" alt="kitten"/></a></li>` ,
258+ )
244259
245260 // raw html
246- b .AssertFileContent ("public/p4/index.html" , `
247- <li><a href="#some-raw-html">Some <span>raw</span> HTML</a></li>
248- ` )
261+ b .AssertFileContent ("public/p4/index.html" ,
262+ ` <li><a href="#some-raw-html">Some <span>raw</span> HTML</a></li>` ,
263+ )
249264
250265 // typographer
251- b .AssertFileContent ("public/p5/index.html" , `
252- <li><a href="#some-typographer-markup">Some “typographer” markup</a></li>
253- ` )
266+ b .AssertFileContent ("public/p5/index.html" ,
267+ ` <li><a href="#some-typographer-markup">Some “typographer” markup</a></li>` ,
268+ )
254269
255270 // strikethrough
256- b .AssertFileContent ("public/p6/index.html" , `
257- <li><a href="#some-deleted-text">Some <del>deleted</del> text</a></li>
258- ` )
271+ b .AssertFileContent ("public/p6/index.html" ,
272+ ` <li><a href="#some-deleted-text">Some <del>deleted</del> text</a></li>` ,
273+ )
259274
260275 // emoji
261-
262- b .AssertFileContent ("public/p7/index.html" , `
263- <li><a href="#a-snake-emoji">A 🐍 emoji</a></li>
264- ` )
276+ b .AssertFileContent ("public/p7/index.html" ,
277+ `<li><a href="#a-snake-emoji">A 🐍 emoji</a></li>` ,
278+ )
279+
280+ // link
281+ b .AssertFileContent ("public/p8/index.html" ,
282+ `<li><a href="#a-link">A link</a></li>` ,
283+ )
265284}
266285
267286func TestIssue13416 (t * testing.T ) {
0 commit comments