From c3cc608570aa473d8777496e857e69637507da25 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Thu, 6 Oct 2022 19:12:42 +0200 Subject: hswg: bump libasciidoc to master --- hswg/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'hswg') diff --git a/hswg/main.go b/hswg/main.go index dca9fea..3c7582e 100644 --- a/hswg/main.go +++ b/hswg/main.go @@ -23,7 +23,6 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/parser" - "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/renderer/sgml/html5" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/bytesparadise/libasciidoc/pkg/validator" @@ -92,8 +91,7 @@ func Render(r io.Reader, config *configuration.Configuration) ( for _, problem := range problems { fmt.Fprintln(os.Stderr, problem.Message) } - ctx := renderer.NewContext(doc, config) - meta.Metadata, err = html5.Render(ctx, doc, html) + meta.Metadata, err = html5.Render(doc, config, html) } if err != nil { // Fallback: output all the text sanitized for direct inclusion. @@ -124,7 +122,7 @@ type Entry struct { // Published returns the date when the entry was published, or nil if unknown. func (e *Entry) Published() *time.Time { - if d, ok, err := e.Attributes.GetAsString("date"); !ok || err != nil { + if d, ok := e.Attributes.GetAsString("date"); !ok { return nil } else if t, err := time.Parse(time.RFC3339, d); err == nil { return &t @@ -194,7 +192,7 @@ func renderEntry(name string, e *Entry) error { configuration.WithFilename(e.PathSource), configuration.WithLastUpdated(e.mtime), configuration.WithAttribute("toc", "preamble"), - configuration.WithAttribute("toc-title", "+++

Contents

+++"), + configuration.WithAttribute("toc-title", "

Contents

"), configuration.WithAttribute("source-highlighter", "chroma"), )); err != nil { return err -- cgit v1.2.3-70-g09d2