diff --git a/pkg/renderer/html5/blank_line_test.go b/pkg/renderer/html5/blank_line_test.go
index 298617cf..2eb55e82 100644
--- a/pkg/renderer/html5/blank_line_test.go
+++ b/pkg/renderer/html5/blank_line_test.go
@@ -19,7 +19,7 @@ second paragraph`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("blank line with spaces and tabs between 2 paragraphs", func() {
@@ -32,7 +32,7 @@ second paragraph`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("blank lines (tabs) at end of document", func() {
@@ -43,7 +43,7 @@ second paragraph`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("blank lines (spaces) at end of document", func() {
@@ -54,6 +54,6 @@ second paragraph`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
diff --git a/pkg/renderer/html5/comment_test.go b/pkg/renderer/html5/comment_test.go
index ffa5f50c..625df931 100644
--- a/pkg/renderer/html5/comment_test.go
+++ b/pkg/renderer/html5/comment_test.go
@@ -14,7 +14,7 @@ var _ = Describe("comments", func() {
It("single line comment alone", func() {
source := `// A single-line comment.`
expected := ""
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single line comment at end of line", func() {
@@ -22,7 +22,7 @@ var _ = Describe("comments", func() {
expected := `
foo // A single-line comment.
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single line comment within a paragraph", func() {
@@ -33,7 +33,7 @@ another line`
a first line
another line
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -45,7 +45,7 @@ a *comment* block
with multiple lines
////`
expected := ""
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("comment block with paragraphs around", func() {
@@ -61,7 +61,7 @@ a second paragraph`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
diff --git a/pkg/renderer/html5/cross_reference_test.go b/pkg/renderer/html5/cross_reference_test.go
index d00ae7607..42713397 100644
--- a/pkg/renderer/html5/cross_reference_test.go
+++ b/pkg/renderer/html5/cross_reference_test.go
@@ -25,7 +25,7 @@ with some content linked to <>!`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("cross-reference with custom id and label", func() {
@@ -41,7 +41,7 @@ with some content linked to <>!`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("invalid section reference", func() {
@@ -58,7 +58,7 @@ with some content linked to <>!`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
})
diff --git a/pkg/renderer/html5/delimited_block_test.go b/pkg/renderer/html5/delimited_block_test.go
index dc6cda7c..9906b55a 100644
--- a/pkg/renderer/html5/delimited_block_test.go
+++ b/pkg/renderer/html5/delimited_block_test.go
@@ -20,7 +20,7 @@ var _ = Describe("delimited blocks", func() {
here
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("fenced block with id and title", func() {
@@ -33,7 +33,7 @@ here
here
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("fenced block with external link inside", func() {
@@ -49,7 +49,7 @@ and more text on the
next lines
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -68,7 +68,7 @@ here
here
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("listing block with ID and title", func() {
@@ -83,7 +83,7 @@ some source code
some source code
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -108,7 +108,7 @@ get '/hi' do
end
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("with title, source and languages attributes", func() {
@@ -131,7 +131,7 @@ get '/hi' do
end
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("with id, title, source and languages attributes", func() {
@@ -155,7 +155,7 @@ get '/hi' do
end
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("with html content", func() {
@@ -167,7 +167,7 @@ end
<a>link</a>
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("with other content", func() {
@@ -179,7 +179,7 @@ end
a<<b
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -207,7 +207,7 @@ with bold content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("example block with multiple elements - case 2", func() {
@@ -226,7 +226,7 @@ and more content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("example block with multiple elements - case 3", func() {
@@ -245,7 +245,7 @@ and "more" content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("example block with ID and title", func() {
@@ -262,7 +262,7 @@ foo
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -298,7 +298,7 @@ with bold content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("admonition block with ID and title", func() {
@@ -334,7 +334,7 @@ with bold content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("admonition block with ID, title and icon", func() {
source := `:icons: font
@@ -371,7 +371,7 @@ with bold content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("admonition paragraph and admonition block with multiple elements", func() {
@@ -416,7 +416,7 @@ this is an admonition paragraph.
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("admonition paragraph with an icon", func() {
@@ -437,7 +437,7 @@ an admonition text on
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("admonition paragraph with ID, title and icon", func() {
@@ -459,7 +459,7 @@ an admonition text on 1 line.
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -481,7 +481,7 @@ ____`
quote title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single-line quote with author and title, and ID and title ", func() {
@@ -503,7 +503,7 @@ ____`
quote title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("multi-line quote with author and title", func() {
@@ -534,7 +534,7 @@ ____`
quote title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("multi-line quote with author only and nested listing", func() {
@@ -572,7 +572,7 @@ ____`
— john doe
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single-line quote with title only", func() {
@@ -590,7 +590,7 @@ ____`
— quote title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("multi-line quote without author and title", func() {
@@ -610,7 +610,7 @@ are preserved, but not trailing spaces
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("empty quote without author and title", func() {
@@ -623,7 +623,7 @@ ____`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -642,7 +642,7 @@ ____`
verse title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single-line verse with author, id and title ", func() {
@@ -660,7 +660,7 @@ ____`
verse title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("multi-line verse with author and title", func() {
@@ -683,7 +683,7 @@ and more!
verse title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single-line verse with author only", func() {
@@ -697,7 +697,7 @@ ____`
— john doe
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("single-line verse with title only", func() {
@@ -711,7 +711,7 @@ ____`
— verse title
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("multi-line verse without author and title", func() {
@@ -727,7 +727,7 @@ ____`
and tabs
are preserved
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("empty verse without author and title", func() {
@@ -737,7 +737,7 @@ ____`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -755,7 +755,7 @@ some *verse* content
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("sidebar block with id, title, paragraph and sourcecode block", func() {
@@ -782,7 +782,7 @@ bar
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
})
diff --git a/pkg/renderer/html5/distinct_lists_test.go b/pkg/renderer/html5/distinct_lists_test.go
index 394f0729..0bb9cab1 100644
--- a/pkg/renderer/html5/distinct_lists_test.go
+++ b/pkg/renderer/html5/distinct_lists_test.go
@@ -33,7 +33,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("same list with attribute on middle item", func() {
@@ -59,7 +59,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("distinct lists separated by blankline and item attribute - case 1", func() {
@@ -90,7 +90,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("distinct lists separated by blankline and item attribute - case 2", func() {
@@ -124,7 +124,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -142,7 +142,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("same list with multiple comment lines inside", func() {
@@ -161,7 +161,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("distinct lists separated by single comment line", func() {
@@ -183,7 +183,7 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("distinct lists separated by multiple comment lines", func() {
@@ -207,6 +207,6 @@ var _ = Describe("lists of items", func() {
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
diff --git a/pkg/renderer/html5/document.go b/pkg/renderer/html5/document.go
index 87dd34db..111f7112 100644
--- a/pkg/renderer/html5/document.go
+++ b/pkg/renderer/html5/document.go
@@ -107,6 +107,7 @@ func renderDocument(ctx *renderer.Context, output io.Writer) (map[string]interfa
if len(renderedTitle) > 0 {
metadata[types.AttrTitle] = string(renderedTitle)
}
+ metadata["LastUpdated"] = ctx.LastUpdated()
return metadata, nil
}
diff --git a/pkg/renderer/html5/document_attribute_substitution_test.go b/pkg/renderer/html5/document_attribute_substitution_test.go
index 8d97f3aa..c049f4de 100644
--- a/pkg/renderer/html5/document_attribute_substitution_test.go
+++ b/pkg/renderer/html5/document_attribute_substitution_test.go
@@ -22,7 +22,7 @@ a paragraph`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("a paragraph then some attributes", func() {
@@ -34,7 +34,7 @@ a paragraph`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("a paragraph with substitution", func() {
@@ -44,7 +44,7 @@ a paragraph written by {author}`
expected := `
a paragraph written by Xavier
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("paragraphs with definitions, substitutions and resets", func() {
@@ -70,7 +70,7 @@ author is now {author}.`
`
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
It("front-matter then paragraph with substitutions", func() {
@@ -82,7 +82,7 @@ author is {author}.`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -94,7 +94,7 @@ author is {author}.`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
@@ -106,7 +106,7 @@ author is {author}.`
expected := fmt.Sprintf(``, rendered)
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
},
Entry("sp symbol", "sp", " "),
Entry("blank symbol", "blank", ""),
@@ -146,7 +146,7 @@ a {blank} here.`
expected := ``
- Expect(source).To(RenderHTML5Element(expected))
+ Expect(source).To(RenderHTML5Body(expected))
})
})
diff --git a/pkg/renderer/html5/document_details_test.go b/pkg/renderer/html5/document_details_test.go
index 751d1851..e882d08a 100644
--- a/pkg/renderer/html5/document_details_test.go
+++ b/pkg/renderer/html5/document_details_test.go
@@ -51,7 +51,7 @@ Last updated {{.LastUpdated}}