summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-24 21:26:19 +0700
committerShulhan <ms@kilabit.info>2022-07-24 21:26:25 +0700
commit7e5793e5744dc9d88933eddcb4d1b439b74ddf1e (patch)
treed3f476ca6b843a8b4a3502b054e55a8bd134f289
parent84bafebf82cb3f47a701ad55acba1ab936ba5377 (diff)
downloadasciidoctor-go-7e5793e5744dc9d88933eddcb4d1b439b74ddf1e.tar.xz
all: use the Attributes "author_names" to render meta "author" in ToHTML
-rw-r--r--document.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/document.go b/document.go
index d68ccf1..33e3179 100644
--- a/document.go
+++ b/document.go
@@ -197,19 +197,9 @@ func (doc *Document) ToHTML(out io.Writer) (err error) {
fmt.Fprintf(buf, "\n<meta name=\"keywords\" content=%q>", metaValue)
}
- var (
- metaAuthors strings.Builder
- author *Author
- x int
- )
- for x, author = range doc.Authors {
- if x > 0 {
- metaAuthors.WriteString(", ")
- }
- metaAuthors.WriteString(author.FullName())
- }
- if metaAuthors.Len() > 0 {
- fmt.Fprintf(buf, "\n<meta name=%q content=%q>", MetaNameAuthor, metaAuthors.String())
+ metaValue = doc.Attributes[MetaNameAuthorNames]
+ if len(metaValue) > 0 {
+ fmt.Fprintf(buf, "\n<meta name=%q content=%q>", MetaNameAuthor, metaValue)
}
var title string = doc.Title.String()