aboutsummaryrefslogtreecommitdiff
path: root/hswg/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-06-02 22:54:37 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-06-02 22:56:49 +0200
commitd47a8d22379e9353c0c66ab4dea7d3ac9c775519 (patch)
tree39da27d5f4e5ca41d5d838e0bfbd29c5bc05ba57 /hswg/main.go
parenta979edf5b7d0546e7dd79fab62f717084058aeeb (diff)
downloadhaven-d47a8d22379e9353c0c66ab4dea7d3ac9c775519.tar.gz
haven-d47a8d22379e9353c0c66ab4dea7d3ac9c775519.tar.xz
haven-d47a8d22379e9353c0c66ab4dea7d3ac9c775519.zip
Bump libasciidoc dependency
Diffstat (limited to 'hswg/main.go')
-rw-r--r--hswg/main.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/hswg/main.go b/hswg/main.go
index 21ca569..82b3014 100644
--- a/hswg/main.go
+++ b/hswg/main.go
@@ -107,7 +107,11 @@ func Render(r io.Reader, config configuration.Configuration) (
var doc types.Document
if doc, err = parser.ParseDocument(pr, config); err == nil {
- for _, problem := range validator.Validate(&doc) {
+ problems, err := validator.Validate(&doc)
+ if err != nil {
+ fmt.Fprintln(os.Stderr, err)
+ }
+ for _, problem := range problems {
fmt.Fprintln(os.Stderr, problem.Message)
}
ctx := renderer.NewContext(doc, config)
@@ -140,7 +144,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 := e.Metadata.Attributes.GetAsString("date"); !ok {
+ if d, _, err := e.Metadata.Attributes.GetAsString("date"); err != nil {
return nil
} else if t, err := time.Parse(time.RFC3339, d); err == nil {
return &t