hswg: bump libasciidoc to master

This commit is contained in:
2022-10-06 19:12:42 +02:00
parent d643187333
commit c3cc608570
3 changed files with 34 additions and 35 deletions

View File

@@ -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", "+++<h2>Contents</h2>+++"),
configuration.WithAttribute("toc-title", "<h2>Contents</h2>"),
configuration.WithAttribute("source-highlighter", "chroma"),
)); err != nil {
return err