aboutsummaryrefslogtreecommitdiff
path: root/document.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-04-18 19:35:03 +0700
committerShulhan <ms@kilabit.info>2025-04-18 19:35:03 +0700
commit7aef4c19dd9b4b9da2460e22395b6a25a476100f (patch)
treeae5ab80fc8b85d1dba18f9aad343dda1836d1abd /document.go
parent984b3b2c912616de5d8c2de766d4897c255d563e (diff)
downloadasciidoctor-go-7aef4c19dd9b4b9da2460e22395b6a25a476100f.tar.xz
all: fix the logic when applying 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". While at it, export the DocAttrStylesheet.
Diffstat (limited to 'document.go')
-rw-r--r--document.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/document.go b/document.go
index aa89434..1fa88ed 100644
--- a/document.go
+++ b/document.go
@@ -215,8 +215,8 @@ func (doc *Document) ToHTML(out io.Writer) (err error) {
var ok bool
- _, ok = doc.Attributes.Entry[docAttrStylesheet]
- if ok {
+ docAttrValue, ok = doc.Attributes.Entry[DocAttrStylesheet]
+ if ok && len(docAttrValue) == 0 {
buf.WriteByte('\n')
buf.WriteString(_defaultCSS)
}