Escape HTML.

@param  {string} html
@return {string}
@api public
767556
function(html) {
       return html.toString()
         .replace(/&/gmi, '&amp;')
         .replace(/"/gmi, '&quot;')
         .replace(/>/gmi, '&gt;')
         .replace(/</gmi, '&lt;')
     }
624868
public static String htmlEncode(String content) {
		if (null == content) {
			return "";
		}
		return content.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
	}
408410
public static String escapeHtmlAttribute(SoyValue value) {
    value = normalizeNull(value);
    if (isSanitizedContentOfKind(value, SanitizedContent.ContentKind.HTML)) {
      // |escapeHtmlAttribute should only be used on attribute values that cannot have tags.
      return stripHtmlTags(value.coerceToString(), null, true);
    }
    return escapeHtmlAttribute(value.coerceToString());
  }
1196240
public static String unescapeHtml4(String html) {
		Html4Unescape unescape = new Html4Unescape();
		return unescape.replace(html).toString();
	}
671090
def escape(self, string):
        
        html_entities = {"&": "&amp;", '<': '&lt;', '>': '&gt;'}
        return HTML("".join(html_entities.get(c, c) for c in string))
1294277
def _escape(self, text):
        """"""
        ret = EMPTYSTRING if text is None else str(text)
        if self.escape:
            return html_escape(ret)
        else:
            return ret
911181
public static String htmlEncode(String input)
	{
		if (input == null)
		{
			return "";
		}
		StringBuffer retval = new StringBuffer(input);
		StringSupport.replaceAll(retval, "&", "&amp;");
		StringSupport.replaceAll(retval, "<", "&lt;");
		StringSupport.replaceAll(retval, ">", "&gt;");
		StringSupport.replaceAll(retval, "\"", "&quot;");
		return retval.toString();
	}
872565
def escape_html(text):
    
    text = text.replace('&', '&amp;')
    text = text.replace('<', '&lt;')
    text = text.replace('>', '&gt;')
    text = text.replace('"', '&quot;')
    return text
105095
public function escapeForHtml() {
		$rawString = htmlspecialchars($this->rawString, ENT_QUOTES, $this->charset);

		return new static($rawString, $this->charset);
	}
932150
public function escapeHTML(?string $string, string $charset, bool $doubleEncode = true): string
	{
		return htmlspecialchars($string, ENT_QUOTES, $charset, $doubleEncode);
	}
1070061
public String html(String text) {
        if (text == null || text.isEmpty()) {
            return text;
        }
        return StringEscapeUtils.escapeHtml4(text);
    }
1362746
public static String escapeJS(String str, char quotesUsed) {
	return escapeJS(str, quotesUsed, (CharsetEncoder) null);
    }
1290331
function(attr) {
      var html;
      if (html = this._escapedAttributes[attr]) return html;
      var val = this.attributes[attr];
      return this._escapedAttributes[attr] = escapeHTML(val == null ? '' : '' + val);
    }
653356
function htmlDecode(input) {
  if (input === " ") return input;
  const doc = new DOMParser().parseFromString(input.replace(/<[^>]+>/g, ""), "text/html");
  return doc.documentElement.textContent;
}
1250440
public final String escapeHtml(final String pSource) {
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < pSource.length(); i++) {
      char ch = pSource.charAt(i);
      sb.append(htmlEscape(ch));
    }
    return sb.toString();
  }
564033
function escape (string) {
  return string
    .replace(/ /g, '\\ ')
    .replace(/\n/g, '')
    .replace(/\(/g, '\\(')
    .replace(/\)/g, '\\)');
}
1031600
function escapestr(s) {
            return s.replace(/\\/g, '\\\\')
                    .replace(/'/g, '\\\'')
                    .replace(/"/g, '\\"')
                    .replace(/\r/g, '\\r')
                    .replace(/\n/g, '\\n');
        }