diff options
| author | Shulhan <ms@kilabit.info> | 2022-07-24 21:26:19 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-07-24 21:26:25 +0700 |
| commit | 7e5793e5744dc9d88933eddcb4d1b439b74ddf1e (patch) | |
| tree | d3f476ca6b843a8b4a3502b054e55a8bd134f289 | |
| parent | 84bafebf82cb3f47a701ad55acba1ab936ba5377 (diff) | |
| download | asciidoctor-go-7e5793e5744dc9d88933eddcb4d1b439b74ddf1e.tar.xz | |
all: use the Attributes "author_names" to render meta "author" in ToHTML
| -rw-r--r-- | document.go | 16 |
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() |
