summaryrefslogtreecommitdiffstats
path: root/markup/asciidocext
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-19 18:19:46 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2021-06-19 18:19:46 +0200
commita7e3da242f98d4799dad013d7ba2f285717640d6 (patch)
tree90c4b9691da4454de6df23e2cc25711648834df4 /markup/asciidocext
parentb70a12ec45ffd2afea6137bc25b8f3aa1337268f (diff)
markup: Rename Header(s) to Heading(s) in ToC struct
Because that is what it is.
Diffstat (limited to 'markup/asciidocext')
-rw-r--r--markup/asciidocext/convert.go2
-rw-r--r--markup/asciidocext/convert_test.go52
2 files changed, 27 insertions, 27 deletions
diff --git a/markup/asciidocext/convert.go b/markup/asciidocext/convert.go
index 10e16810e..ff843cb6e 100644
--- a/markup/asciidocext/convert.go
+++ b/markup/asciidocext/convert.go
@@ -276,7 +276,7 @@ func parseTOC(doc *html.Node) tableofcontents.Root {
continue
}
href := attr(c, "href")[1:]
- toc.AddAt(tableofcontents.Header{
+ toc.AddAt(tableofcontents.Heading{
Text: nodeContent(c),
ID: href,
}, row, level)
diff --git a/markup/asciidocext/convert_test.go b/markup/asciidocext/convert_test.go
index 14110bb04..acc525c3b 100644
--- a/markup/asciidocext/convert_test.go
+++ b/markup/asciidocext/convert_test.go
@@ -340,42 +340,42 @@ testContent
toc, ok := r.(converter.TableOfContentsProvider)
c.Assert(ok, qt.Equals, true)
expected := tableofcontents.Root{
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
ID: "",
Text: "",
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
- ID: "_introduction",
- Text: "Introduction",
- Headers: nil,
+ ID: "_introduction",
+ Text: "Introduction",
+ Headings: nil,
},
{
ID: "_section_1",
Text: "Section 1",
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
ID: "_section_1_1",
Text: "Section 1.1",
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
- ID: "_section_1_1_1",
- Text: "Section 1.1.1",
- Headers: nil,
+ ID: "_section_1_1_1",
+ Text: "Section 1.1.1",
+ Headings: nil,
},
},
},
{
- ID: "_section_1_2",
- Text: "Section 1.2",
- Headers: nil,
+ ID: "_section_1_2",
+ Text: "Section 1.2",
+ Headings: nil,
},
},
},
{
- ID: "_section_2",
- Text: "Section 2",
- Headers: nil,
+ ID: "_section_2",
+ Text: "Section 2",
+ Headings: nil,
},
},
},
@@ -408,15 +408,15 @@ func TestTableOfContentsWithCode(t *testing.T) {
toc, ok := r.(converter.TableOfContentsProvider)
c.Assert(ok, qt.Equals, true)
expected := tableofcontents.Root{
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
ID: "",
Text: "",
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
- ID: "_some_code_in_the_title",
- Text: "Some <code>code</code> in the title",
- Headers: nil,
+ ID: "_some_code_in_the_title",
+ Text: "Some <code>code</code> in the title",
+ Headings: nil,
},
},
},
@@ -452,15 +452,15 @@ func TestTableOfContentsPreserveTOC(t *testing.T) {
toc, ok := r.(converter.TableOfContentsProvider)
c.Assert(ok, qt.Equals, true)
expected := tableofcontents.Root{
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
ID: "",
Text: "",
- Headers: tableofcontents.Headers{
+ Headings: tableofcontents.Headings{
{
- ID: "some-title",
- Text: "Some title",
- Headers: nil,
+ ID: "some-title",
+ Text: "Some title",
+ Headings: nil,
},
},
},