diff options
author | Joe Mooring <joe.mooring@veriphor.com> | 2023-10-08 16:59:36 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-10-09 18:42:03 +0200 |
commit | 1b5f78b6b7335b02b6207a637498c4c8817999d1 (patch) | |
tree | b124d86ff9eef7356594eba3d8b5d14008277e87 /markup/goldmark/toc_test.go | |
parent | d5d0f420d8e900126d1a733ca7a9d751288b8b26 (diff) |
markup/tableofcontents: Return template.HTML from .Fragments.ToHTML
Closes #11545
Diffstat (limited to 'markup/goldmark/toc_test.go')
-rw-r--r-- | markup/goldmark/toc_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/markup/goldmark/toc_test.go b/markup/goldmark/toc_test.go index f7f7bb7a0..1b846877b 100644 --- a/markup/goldmark/toc_test.go +++ b/markup/goldmark/toc_test.go @@ -62,7 +62,8 @@ And then some. c.Assert(err, qt.IsNil) b, err := conv.Convert(converter.RenderContext{Src: []byte(content), RenderTOC: true, GetRenderer: nopGetRenderer}) c.Assert(err, qt.IsNil) - got := b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(2, 3, false) + tocHTML := b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(2, 3, false) + got := string(tocHTML) c.Assert(got, qt.Equals, `<nav id="TableOfContents"> <ul> <li><a href="#first-h2---now-with-typography">First h2—now with typography!</a> @@ -104,7 +105,8 @@ func TestEscapeToc(t *testing.T) { // content := "" b, err := safeConv.Convert(converter.RenderContext{Src: []byte(content), RenderTOC: true, GetRenderer: nopGetRenderer}) c.Assert(err, qt.IsNil) - got := b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(1, 2, false) + tocHTML := b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(1, 2, false) + got := string(tocHTML) c.Assert(got, qt.Equals, `<nav id="TableOfContents"> <ul> <li><a href="#a--b--c--d">A < B & C > D</a></li> @@ -116,7 +118,8 @@ func TestEscapeToc(t *testing.T) { b, err = unsafeConv.Convert(converter.RenderContext{Src: []byte(content), RenderTOC: true, GetRenderer: nopGetRenderer}) c.Assert(err, qt.IsNil) - got = b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(1, 2, false) + tocHTML = b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(1, 2, false) + got = string(tocHTML) c.Assert(got, qt.Equals, `<nav id="TableOfContents"> <ul> <li><a href="#a--b--c--d">A < B & C > D</a></li> |