diff options
| author | Shulhan <ms@kilabit.info> | 2025-04-18 19:59:04 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-04-18 19:59:04 +0700 |
| commit | 627748152584a34070096c02fcd0ecbc1af85422 (patch) | |
| tree | e8e9b043d8e809223ba7d2d256215e86f9f7b9e8 /filehtml.go | |
| parent | 5eb1667e6906cf30642e926b56fdbc9686d1233f (diff) | |
| download | ciigo-627748152584a34070096c02fcd0ecbc1af85422.tar.xz | |
go.mod: update asciidoctor-go module to fix default embedded CSS
By default, the document contains ":stylesheet:" attribute, which
means using the default embedded CSS.
To disable it, unset the attribute using ":stylesheet!:".
To overwrite it, set the attribute to path of CSS file
":stylesheet: my.css".
Diffstat (limited to 'filehtml.go')
| -rw-r--r-- | filehtml.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/filehtml.go b/filehtml.go index da1de1d..f770ad8 100644 --- a/filehtml.go +++ b/filehtml.go @@ -12,8 +12,7 @@ import ( ) const ( - metadataStylesheet = `stylesheet` - metadataTitle = `title` + metadataTitle = `title` ) // fileHTML represent an HTML metadata for header and its body. @@ -45,8 +44,10 @@ func (fhtml *fileHTML) unpackAdocMetadata(doc *asciidoctor.Document) { for k, v = range doc.Attributes.Entry { switch k { - case metadataStylesheet: - fhtml.Styles = append(fhtml.Styles, v) + case asciidoctor.DocAttrStylesheet: + if len(v) != 0 { + fhtml.Styles = append(fhtml.Styles, v) + } case asciidoctor.DocAttrAuthorNames: fhtml.Metadata[asciidoctor.DocAttrAuthor] = v case asciidoctor.DocAttrDescription, @@ -79,7 +80,7 @@ func (fhtml *fileHTML) unpackMarkdownMetadata(metadata map[string]any) { key = strings.ToLower(key) switch key { - case metadataStylesheet: + case asciidoctor.DocAttrStylesheet: fhtml.Styles = append(fhtml.Styles, vstr) case metadataTitle: fhtml.Title = vstr |
