diff --git a/libasciidoc_test.go b/libasciidoc_test.go index 5cf91786..3fe78141 100644 --- a/libasciidoc_test.go +++ b/libasciidoc_test.go @@ -268,7 +268,8 @@ Last updated {{.LastUpdated}} -` + +` filename := "test/includes/chapter-a.adoc" stat, err := os.Stat(filename) Expect(err).NotTo(HaveOccurred()) @@ -390,7 +391,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderHTML(source, configuration.WithAttribute(types.AttrDocType, "manpage"), configuration.WithLastUpdated(lastUpdated), @@ -469,7 +471,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderHTML(source, configuration.WithAttribute(types.AttrDocType, "manpage"), configuration.WithLastUpdated(lastUpdated), @@ -505,7 +508,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(Render(source, configuration.WithBackEnd("html5"), configuration.WithLastUpdated(lastUpdated), @@ -540,7 +544,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(Render(source, configuration.WithBackEnd("xhtml5"), configuration.WithLastUpdated(lastUpdated), diff --git a/pkg/renderer/sgml/html5/document_details_test.go b/pkg/renderer/sgml/html5/document_details_test.go index 1d0040bd..73dbbcc1 100644 --- a/pkg/renderer/sgml/html5/document_details_test.go +++ b/pkg/renderer/sgml/html5/document_details_test.go @@ -55,7 +55,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now))).To(MatchHTMLTemplate(expected, now)) }) @@ -93,7 +94,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now))). To(MatchHTMLTemplate(expected, now)) @@ -132,7 +134,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -163,7 +166,8 @@ a paragraph` -` + +` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -198,7 +202,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -228,7 +233,8 @@ a paragraph` -` + +` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), diff --git a/pkg/renderer/sgml/html5/html5.go b/pkg/renderer/sgml/html5/html5.go index 70ec04be..4e89fbad 100644 --- a/pkg/renderer/sgml/html5/html5.go +++ b/pkg/renderer/sgml/html5/html5.go @@ -26,7 +26,7 @@ const ( "\n" + "\n{{ end }}" + "\n" + - "" + "\n" articleHeaderTmpl = "
\n" + "

{{ .Header }}

\n" + diff --git a/pkg/renderer/sgml/html5/html5_test.go b/pkg/renderer/sgml/html5/html5_test.go index f285e8be..376cbb35 100644 --- a/pkg/renderer/sgml/html5/html5_test.go +++ b/pkg/renderer/sgml/html5/html5_test.go @@ -37,7 +37,8 @@ Last updated {{.LastUpdated}}
-` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -70,7 +71,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -103,7 +105,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -321,7 +324,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderHTML(source, configuration.WithFilename("test.adoc"), configuration.WithAttributes(map[string]string{ diff --git a/pkg/renderer/sgml/xhtml5/document_details_test.go b/pkg/renderer/sgml/xhtml5/document_details_test.go index 36cb39a0..c7d6da31 100644 --- a/pkg/renderer/sgml/xhtml5/document_details_test.go +++ b/pkg/renderer/sgml/xhtml5/document_details_test.go @@ -55,7 +55,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now))).To(MatchHTMLTemplate(expected, now)) }) @@ -93,7 +94,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now))). To(MatchHTMLTemplate(expected, now)) @@ -132,7 +134,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -163,7 +166,8 @@ a paragraph` -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -206,7 +210,8 @@ a paragraph` -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -249,7 +254,8 @@ a paragraph` -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -284,7 +290,8 @@ Last updated {{.LastUpdated}} -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), @@ -314,7 +321,8 @@ a paragraph` -` + +` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), diff --git a/pkg/renderer/sgml/xhtml5/xhtml5.go b/pkg/renderer/sgml/xhtml5/xhtml5.go index 0a7eb74c..92ee8837 100644 --- a/pkg/renderer/sgml/xhtml5/xhtml5.go +++ b/pkg/renderer/sgml/xhtml5/xhtml5.go @@ -26,5 +26,5 @@ const ( "\n" + "\n{{ end }}" + "\n" + - "" + "\n" ) diff --git a/pkg/renderer/sgml/xhtml5/xhtml5_test.go b/pkg/renderer/sgml/xhtml5/xhtml5_test.go index 821dc458..aea2fd5b 100644 --- a/pkg/renderer/sgml/xhtml5/xhtml5_test.go +++ b/pkg/renderer/sgml/xhtml5/xhtml5_test.go @@ -37,7 +37,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -70,7 +71,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -103,7 +105,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithCSS("/path/to/style.css"), @@ -321,7 +324,8 @@ Last updated {{.LastUpdated}} -` + +` now := time.Now() Expect(RenderXHTML(source, configuration.WithFilename("test.adoc"), configuration.WithAttributes(map[string]string{