// SetEscapeHTML escape html by default, set to false to disable
777759
func (adapter *Encoder) SetEscapeHTML(escapeHTML bool) {
	config := adapter.stream.cfg.configBeforeFrozen
	config.EscapeHTML = escapeHTML
	adapter.stream.cfg = config.frozeWithCacheReuse(adapter.stream.cfg.extraExtensions)
}
675542
func SetForToken(document interface{}, decodedToken string, value interface{}) (interface{}, error) {
	return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider)
}
590536
func (c *Controller) RenderHTML(html string) Result {
	c.setStatusIfNil(http.StatusOK)

	return &RenderHTMLResult{html}
}
1171064
func JSEscape(w io.Writer, b []byte) {
	last := 0
	for i := 0; i < len(b); i++ {
		c := b[i]

		if !jsIsSpecial(rune(c)) {
			// fast path: nothing to do
			continue
		}
		w.Write(b[last:i])

		if c < utf8.RuneSelf {
			// Quotes, slashes and angle brackets get quoted.
			// Control characters get written as \u00XX.
			switch c {
			case '\\':
				w.Write(jsBackslash)
			case '\'':
				w.Write(jsApos)
			case '"':
				w.Write(jsQuot)
			case '<':
				w.Write(jsLt)
			case '>':
				w.Write(jsGt)
			default:
				w.Write(jsLowUni)
				t, b := c>>4, c&0x0f
				w.Write(hex[t : t+1])
				w.Write(hex[b : b+1])
			}
		} else {
			// Unicode rune.
			r, size := utf8.DecodeRune(b[i:])
			if unicode.IsPrint(r) {
				w.Write(b[i : i+size])
			} else {
				fmt.Fprintf(w, "\\u%04X", r)
			}
			i += size - 1
		}
		last = i + 1
	}
	w.Write(b[last:])
}
1342383
func (t *TemplateRenderable) RenderHTML(_ ...string) template.HTML {
	return template.HTML(t.Render())
}
574910
func charsetFromHTMLString(htmlString string) (string, error) {
	if charsetRegexp == nil {
		var err error
		charsetRegexp, err = regexp.Compile(`(?i)<meta.*charset="?\s*(?P<charset>[a-zA-Z0-9_.:-]+)\s*"`)
		if err != nil {
			charsetRegexp = nil
			return "", err
		}
	}

	charsetMatches := charsetRegexp.FindAllStringSubmatch(htmlString, -1)

	if len(charsetMatches) > 0 {
		n1 := charsetRegexp.SubexpNames()
		r2 := charsetMatches[0]

		md := map[string]string{}
		for i, n := range r2 {
			md[n1[i]] = n
		}

		return md["charset"], nil
	}

	return "", errParsingCharset
}
815391
func bashEscape(s string) string {
	return escapeRegExp.ReplaceAllStringFunc(s, func(c string) string {
		if c == `\` {
			return `\\\\`
		}
		return `\\` + c
	})
}
209625
func (s *CSVOutput) SetQuoteEscapeCharacter(v string) *CSVOutput {
	s.QuoteEscapeCharacter = &v
	return s
}
924087
func HTMLEscapeString(s string) string {
	// Avoid allocation if we can.
	if strings.IndexAny(s, `'"&<>`) < 0 {
		return s
	}
	var b bytes.Buffer
	HTMLEscape(&b, []byte(s))
	return b.String()
}
299876
func (s *GetRegexPatternSetOutput) SetRegexPatternSet(v *RegexPatternSet) *GetRegexPatternSetOutput {
	s.RegexPatternSet = v
	return s
}
622808
func (s *CSVInput) SetQuoteEscapeCharacter(v string) *CSVInput {
	s.QuoteEscapeCharacter = &v
	return s
}
1162079
func (client *Client) SetTagsContext(t map[string]string) {
	client.mu.Lock()
	defer client.mu.Unlock()
	client.context.setTags(t)
}
1148893
func (f *Queries) MustEscape(key string, defaults ...string) string {
	if v, ok := f.Values()[key]; ok {
		return template.HTMLEscapeString(v[0])
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return ""
}
1225459
func (c *DOM) SetOuterHTMLWithParams(v *DOMSetOuterHTMLParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "DOM.setOuterHTML", Params: v})
}
1209002
func EscapeString(ch *Changeset, fields ...string) {
	for _, field := range fields {
		ApplyString(ch, field, html.EscapeString)
	}
}
798305
func (r *Request) SetJSONEscapeHTML(b bool) *Request {
	r.jsonEscapeHTML = b
	return r
}
806320
func setProtection(formatStyle *formatStyle) *xlsxProtection {
	var protection xlsxProtection
	if formatStyle.Protection != nil {
		protection.Hidden = formatStyle.Protection.Hidden
		protection.Locked = formatStyle.Protection.Locked
	}
	return &protection
}