Bump libasciidoc
This commit is contained in:
10
hswg/main.go
10
hswg/main.go
@@ -63,7 +63,7 @@ func (m *Metadata) AttrList(name string) []string {
|
||||
|
||||
// Render converts an io.Reader with an AsciiDoc document to HTML. So long as
|
||||
// the file could be read at all, it will always return a non-empty document.
|
||||
func Render(r io.Reader, config configuration.Configuration) (
|
||||
func Render(r io.Reader, config *configuration.Configuration) (
|
||||
html *bytes.Buffer, meta Metadata, err error) {
|
||||
html = bytes.NewBuffer(nil)
|
||||
|
||||
@@ -81,9 +81,11 @@ func Render(r io.Reader, config configuration.Configuration) (
|
||||
// io.Copy(os.Stdout, pr)
|
||||
// return
|
||||
|
||||
var doc types.Document
|
||||
var doc *types.Document
|
||||
if doc, err = parser.ParseDocument(pr, config); err == nil {
|
||||
problems, verr := validator.Validate(&doc)
|
||||
doctype := config.Attributes.GetAsStringWithDefault(
|
||||
types.AttrDocType, "article")
|
||||
problems, verr := validator.Validate(doc, doctype)
|
||||
if verr != nil {
|
||||
fmt.Fprintln(os.Stderr, verr)
|
||||
}
|
||||
@@ -104,7 +106,7 @@ func Render(r io.Reader, config configuration.Configuration) (
|
||||
}
|
||||
_, _ = html.WriteString("</pre>")
|
||||
}
|
||||
meta.Attributes = doc.Attributes
|
||||
meta.Attributes = config.Attributes
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user