aboutsummaryrefslogtreecommitdiff
path: root/html_backend.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-02-12 12:54:48 +0700
committerShulhan <ms@kilabit.info>2023-03-02 23:25:12 +0700
commitfe8bd4d6305e82259eaac94972f1621aa52e89aa (patch)
tree3e0036fe349e41564c7596a23d80c0ec06ff3dfa /html_backend.go
parent7059665463bd648321fbd8c4b9227ead65767975 (diff)
downloadasciidoctor-go-fe8bd4d6305e82259eaac94972f1621aa52e89aa.tar.xz
all: handle empty preamble
If the document contains empty preamble do not output the HTML wrapper of it.
Diffstat (limited to 'html_backend.go')
-rw-r--r--html_backend.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/html_backend.go b/html_backend.go
index b3f5adb..100fab1 100644
--- a/html_backend.go
+++ b/html_backend.go
@@ -979,6 +979,8 @@ func htmlWriteHeader(doc *Document, out io.Writer) {
fmt.Fprint(out, "\n<div id=\"header\">")
var (
+ haveHeader = doc.haveHeader()
+
author *Author
prefix string
sep string
@@ -996,7 +998,9 @@ func htmlWriteHeader(doc *Document, out io.Writer) {
}
}
- fmt.Fprint(out, "\n<div class=\"details\">")
+ if haveHeader {
+ fmt.Fprint(out, "\n<div class=\"details\">")
+ }
var authorID, emailID string
for x, author = range doc.Authors {
@@ -1042,7 +1046,9 @@ func htmlWriteHeader(doc *Document, out io.Writer) {
fmt.Fprintf(out, "\n<br><span id=%q>%s</span>",
metaNameRevRemark, doc.Revision.Remark)
}
- fmt.Fprint(out, "\n</div>")
+ if haveHeader {
+ fmt.Fprint(out, "\n</div>")
+ }
if doc.tocIsEnabled && (doc.tocPosition == `` ||
doc.tocPosition == metaValueAuto ||