func parseHTML(html string) model.FormattedText { node, err := utils.ParseHTML(strings.NewReader(html)) if err != nil { return nil } return model.HTML{Root: node} }
func processHTML(text string, images model.ImagesDict) model.FormattedText { node, err := utils.ParseHTML(strings.NewReader(text)) if err != nil { return model.RawText(text) } processHTMLNode(node, images) return model.HTML{Root: node} }
func parseSGML(textNode *SGMLNode) model.FormattedText { if textNode == nil { return nil } node, err := utils.ParseHTML(strings.NewReader(textNode.Text)) if err != nil { return nil } transformSGML(node) return SGML{HTML: model.HTML{Root: node}} }