//go:build js && wasm package ultraviolet import ( "syscall/js" ) type MarkdownComponentWeb struct { node js.Value view View change bool content string } func NewMarkdownComponentWeb(view View) *MarkdownComponentWeb { return &MarkdownComponentWeb{ view: view, change: true, } } // Component func (this *MarkdownComponentWeb) Build(parent Component) { this.node = WebBuildDiv( this.node, parent, this.view, "", MarkdownConvert(this.content), AbstractHandlers{}, ) } func (this *MarkdownComponentWeb) Invalidate() bool { result := this.change this.change = false return result } func (this *MarkdownComponentWeb) Clean() { WebCleanChildren(this.node) this.change = true } // JS func (this *MarkdownComponentWeb) Node() js.Value { return this.node } // ComponentMarkdown func (this *MarkdownComponentWeb) SetMarkdown(content string) { this.content = content }