diff --git a/public/parsing.wasm b/public/parsing.wasm index 267dc2d1..202bf536 100755 Binary files a/public/parsing.wasm and b/public/parsing.wasm differ diff --git a/src/parsing/ggcode.go b/src/parsing/ggcode.go index 50a83ba7..d0c46eba 100644 --- a/src/parsing/ggcode.go +++ b/src/parsing/ggcode.go @@ -78,6 +78,27 @@ var ggcodeTags = map[string]ggcodeTag{ return nil }, }, + "figure": { + Filter: ggcodeFilterEdu, + Renderer: func(c ggcodeRendererContext, n *ggcodeNode, entering bool) error { + if entering { + c.W.WriteString(`
`) + var srcAttr, altAttr string + if src := n.Args["src"]; src != "" { + srcAttr = fmt.Sprintf(` src="%s"`, src) + } + if alt := n.Args["alt"]; alt != "" { + altAttr = fmt.Sprintf(` alt="%s"`, alt) + } + c.W.WriteString(fmt.Sprintf(``, srcAttr, altAttr)) + c.W.WriteString(`
`) + } else { + c.W.WriteString(`
`) + c.W.WriteString(`
`) + } + return nil + }, + }, } // ----------------------