From f1943adfc9628522628803e03a86a2fef12ef2e9 Mon Sep 17 00:00:00 2001 From: Olivier Wulveryck Date: Mon, 12 Jun 2023 19:51:46 +0200 Subject: [PATCH] feat: if no map, display the canvas --- examples/webassembly/wasm/main.go | 2 +- examples/wtg2svg/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/webassembly/wasm/main.go b/examples/webassembly/wasm/main.go index 1096000..04006ff 100644 --- a/examples/webassembly/wasm/main.go +++ b/examples/webassembly/wasm/main.go @@ -124,7 +124,7 @@ func wtg2SVG(s string, width int, height int, withAnnotations bool) (string, err buf := bytes.NewBufferString(s) err := p.Parse(buf) - if err != nil { + if err != nil && err != wtg.ErrEmptyMap { return "", err } if len(p.InvalidEntries) != 0 { diff --git a/examples/wtg2svg/main.go b/examples/wtg2svg/main.go index 93ff936..4ff40a8 100644 --- a/examples/wtg2svg/main.go +++ b/examples/wtg2svg/main.go @@ -40,7 +40,7 @@ func main() { p := wtg.NewParser() err = p.Parse(os.Stdin) - if err != nil { + if err != nil && err != wtg.ErrEmptyMap { log.Fatal(err) } if len(p.InvalidEntries) != 0 {