// AppendHtml parses the html and appends it to the set of matched elements.
766701
func (s *Selection) AppendHtml(html string) *Selection {
	return s.AppendNodes(parseHtml(html)...)
}
986354
func HTML(lang string, code []byte) ([]byte, error) {
	h, err := makeAndHighlight(lang, code)
	if err != nil {
		return nil, err
	}

	var buf bytes.Buffer
	buf.Write([]byte(`<div class="highlight"><pre><code>`))
	h.render(&buf, func(w io.Writer, class string, body []byte) {
		escaped := html.EscapeString(string(body))
		if len(class) > 0 {
			fmt.Fprintf(w, "<span class=\"%s\">%s</span>", class, escaped)
		} else {
			w.Write([]byte(escaped))
		}
	})
	buf.Write([]byte(`</code></pre></div>`))
	return buf.Bytes(), nil
}
19837
func (c *C) HTML(name string, data interface{}) {
	c.render.Render(c.Writer, name, data)
}
926989
func (text *Text) Append(rawSentence string, words []string) {
	if len(words) > 0 {
		parsedSentence := ParsedSentence{
			original: rawSentence,
			words:    words,
		}

		text.parsedSentences = append(
			text.parsedSentences,
			parsedSentence,
		)
	}
}
1118893
func (hl *HandlerList) Append(h Handler) {
	hl.list = append(hl.list, h)
}
1034660
func (tn *tagNode) appendChild(n Node) {
	tn.children = append(tn.children, n)
}
58498
func (ctx *context) HTML(htmlContents string) (int, error) {
	ctx.ContentType(ContentHTMLHeaderValue)
	return ctx.writer.WriteString(htmlContents)
}
1140464
func (l LinkSet) HTML() template.HTML {
	if len(l) == 0 {
		return ""
	}
	buf := bytes.Buffer{}
	if err := linkifySetTemplate.Execute(&buf, l); err != nil {
		panic(err)
	}
	return template.HTML(buf.Bytes())
}
6904
func (list *List) Append(value Value) {
	list.values = append(list.values, value)
}
517505
func AppendArray(b []byte, n int) []byte {
	return appendPrefix(b, '*', int64(n))
}
64382
func (ctx *Context) HTML(src ...string) *Context {
	ctx.SetContentType(htmlCT)
	if len(src) > 0 {
		_, e := ctx.WriteString(src[0])
		_ = e
	}
	return ctx
}
889725
func (eBase *elementBase) AppendChild(child element) {
	switch c := child.(type) {
	case *mixinInvocation:
		eBase.mixins = append(eBase.mixins, c)
	case *declaration:
		eBase.decs = append(eBase.decs, c)
	case *selector:
		eBase.sels = append(eBase.sels, c)
	}
}
454329
func (r *Render) Html(w http.ResponseWriter, status int, name string, binding interface{}) error {
	if r.opt.IsDevelopment {
		r.compile()
	}

	if tSet, ok := r.templates[name]; !ok {
		return fmt.Errorf("Cannot find template %q in Render", name)
	} else {
		if r.opt.UseBufPool {
			buf := r.bufPool.Get()
			if err := tSet.template.Execute(buf, binding); err != nil {
				return fmt.Errorf("Template execution error, %s", err)
			}
			w.Header().Set("Content-Type", kContentHtml+kContentCharset)
			w.WriteHeader(status)
			_, err := buf.WriteTo(w)
			r.bufPool.Put(buf)
			return err
		} else {
			out := new(bytes.Buffer)
			if err := tSet.template.Execute(out, binding); err != nil {
				return fmt.Errorf("Template execution error, %s", err)
			}
			w.Header().Set("Content-Type", kContentHtml+kContentCharset)
			w.WriteHeader(status)
			_, err := io.Copy(w, out)
			return err
		}
	}
}
42480
func (b *XMLBase) ResolveHTML(relHTML string) (string, error) {
	if b.CurrentBase() == "" {
		return relHTML, nil
	}

	htmlReader := strings.NewReader(relHTML)

	doc, err := html.Parse(htmlReader)
	if err != nil {
		return relHTML, err
	}

	var visit func(*html.Node)

	// recursively traverse HTML resolving any relative URIs in attributes
	visit = func(n *html.Node) {
		if n.Type == html.ElementNode {
			for i, a := range n.Attr {
				if htmlURIAttrs[a.Key] {
					absVal, err := b.ResolveURL(a.Val)
					if err == nil {
						n.Attr[i].Val = absVal
					}
					break
				}
			}
		}
		for c := n.FirstChild; c != nil; c = c.NextSibling {
			visit(c)
		}
	}

	visit(doc)
	var w bytes.Buffer
	err = html.Render(&w, doc)
	if err != nil {
		return relHTML, err
	}

	// html.Render() always writes a complete html5 document, so strip the html
	// and body tags
	absHTML := w.String()
	absHTML = strings.TrimPrefix(absHTML, "<html><head></head><body>")
	absHTML = strings.TrimSuffix(absHTML, "</body></html>")

	return absHTML, err
}
1219722
func ParseHtml(t string) NarrowDom {
	parsed := jquery.ParseHTML(t)
	var nDom NarrowDom
	if TestMode {
		nDom = newTestOps()
	} else {
		if len(parsed) > 1 {
			div := jquery.NewJQuery(jquery.ParseHTML("<div/>"))
			div.Append(parsed...)
			return wrap(div)
		} else {
			nDom = wrap(jquery.NewJQuery(parsed[0]))
		}
	}
	return nDom
}
438370
func (d *Dataset) AppendTagged(row []interface{}, tags ...string) error {
	if err := d.Append(row); err != nil {
		return err
	}
	d.tags[d.rows-1] = tags[:]
	return nil
}
951884
func (l *BodyNode) Append(n Node) {
	l.Nodes = append(l.Nodes, n)
}