Parses escaped special characters.
This allow a backslash to be interpreted as LaTeX
@marker \
334564
protected function parseEscape($text)
	{
		if (isset($text[1]) && in_array($text[1], $this->escapeCharacters)) {
			if ($text[1] === '\\') {
				return [['backslash'], 2];
			}
			return [['text', $text[1]], 2];
		}
		return [['text', $text[0]], 1];
	}
1129601
def _parse_and_return_quoted_string(self):
        
        result = []
        pos = self.pos + 1
        segment_begin = pos
        my_chr = my_unichr if isinstance(self.text, my_unicode) else utf8chr
        while pos < self.end:
            c = self.text[pos]
            if c < ' ' and c != '\t':
                self.skip_to(pos)
                self.error('Encountered a control character that isn\'t allowed in quoted strings.')
            elif c == '"':
                if segment_begin < pos:
                    result.append(self.text[segment_begin:pos])
                pos += 1
                return ''.join(result), True, pos
            elif c == '\\':
                if segment_begin < pos:
                    result.append(self.text[segment_begin:pos])
                pos += 1
                if pos >= self.end:
                    break
                c = self.text[pos]
                if c == 'u':
                    code_point, pos = self._handle_unicode_escape(pos)
                    result.append(my_chr(code_point))
                else:
                    char, pos = self._handle_escape(pos, c)
                    result.append(char)
                segment_begin = pos
            else:
                pos += 1
        self.error('Reached the end of stream while parsing quoted string.')
223083
function jsEscape(s) {
  var result = '"';
  for (var i = 0; i < s.length; i++) {
    let cp = s.charCodeAt(i);
    let special = specialEscape[cp];
    if (special !== undefined) {
      result += special;
    } else if (cp >= 0x20 && cp <= 0x7e) {
      result += String.fromCodePoint(cp);
    } else {
      result += '\\u' + zeroPaddedHex(cp, 4);
    }
  }
  result += '"';
  return result;
}
1035726
function pg_escape(val){
	if (val === null)
		return 'NULL';
	var backslash = ~val.indexOf('\\');
	var prefix = backslash ? 'E' : '';
	val = val.replace(REG_ESCAPE_1, '\'\'').replace(REG_ESCAPE_2, '\\\\');
	return prefix + '\'' + val + '\'';
}
429834
def _escaped(self):
        

        chars = self._token_info['chars']
        count = len(chars)

        # prev char is escape, keep going
        if count and chars[count - 1] == self.ESCAPE:
            chars.pop()  # swallow escape char
            return True
        else:
            return False
507120
def decode_escapes(s):
    ''''''
    def decode_match(match):
        return codecs.decode(match.group(0), 'unicode-escape')

    return ESCAPE_SEQUENCE_RE.sub(decode_match, s)
987359
def _EscapeGlobCharacters(path):
  
  drive, path = os.path.splitdrive(path)
  return '%s%s' % (drive, _ESCAPE_GLOB_CHARACTERS_REGEX.sub(r'[\1]', path))
137836
def _escape_markdown_literals(string):
    
    literals = list("\\`*_{}[]()<>#+-.!:|")
    escape = lambda c: '\\' + c if c in literals else c
    return "".join(map(escape, string))
1247661
function escapeFormat(t) {
  return (
    t
      // Inline single underscore.
      .replace(/([^_])_([^_])/g, '$1 $2')
      // Leading or trailing underscore.
      .replace(/([^_])_$/, '$1 ')
      .replace(/^_([^_])/, ' $1')
      // Double underscore and double dash.
      .replace(/__/g, '_')
      .replace(/--/g, '-')
  )
}
983952
def escape_symbols(txt)
			esc = ''
			txt.to_s.each_byte { |byte|
				esc << if(entity = @@symbol_entities[byte])
					'&' << entity << ';'
				else
          byte
				end
			}
			esc
		end
641015
def char_to_a(char: "\s", strip: true)
      escaped = char.regexp_escape
      split(/(?<!\\)#{escaped}/).map do |v|
        strip ? v.gsub(/\\#{escaped}/, char) : v
      end
    end
1282193
def _sed_esc(string, escape_all=False):
    '''
    
    '''
    special_chars = "^.[$()|*+?{"
    string = string.replace("'", "'\"'\"'").replace("/", "\\/")
    if escape_all is True:
        for char in special_chars:
            string = string.replace(char, "\\" + char)
    return string
535159
def tex_escape(text):
    
    conv = {
        '&': r'\&',
        '%': r'\%',
        '$': r'\$',
        '#': r'\#',
        '_': r'\_',
        '{': r'\{',
        '}': r'\}',
        '~': r'\textasciitilde{}',
        '^': r'\^{}',
        '\\': r'\textbackslash{}',
        '<': r'\textless ',
        '>': r'\textgreater ',
    }
    regex = re.compile(
        '|'.join(
            re.escape(six.text_type(key))
            for key in sorted(conv.keys(), key=lambda item: -len(item))
        )
    )
    return regex.sub(lambda match: conv[match.group()], text)
1332598
function encodeBackslashEscapes(text) {

        text = text.replace(/\\(\\)/g,escapeCharacters_callback);
        text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g,escapeCharacters_callback);

        return text;
    }
707829
def _peek_unicode(
        self, is_long
    ):  # type: (bool) -> Tuple[Optional[str], Optional[str]]
        
        # we always want to restore after exiting this scope
        with self._state(save_marker=True, restore=True):
            if self._current not in {"u", "U"}:
                raise self.parse_error(
                    InternalParserError, "_peek_unicode() entered on non-unicode value"
                )

            self.inc()  # Dropping prefix
            self.mark()

            if is_long:
                chars = 8
            else:
                chars = 4

            if not self.inc_n(chars):
                value, extracted = None, None
            else:
                extracted = self.extract()

                if extracted[0].lower() == "d" and extracted[1].strip("01234567"):
                    return None, None

                try:
                    value = chr(int(extracted, 16))
                except ValueError:
                    value = None

            return value, extracted
517707
function decodeCssEscape(s) {
    var i = parseInt(s.substring(1), 16);
    // If parseInt didn't find a hex diigt, it returns NaN so return the
    // escaped character.
    // Otherwise, parseInt will stop at the first non-hex digit so there's no
    // need to worry about trailing whitespace.
    if (i > 0xffff) {
      // A supplemental codepoint.
      return i -= 0x10000,
        String.fromCharCode(
            0xd800 + (i >> 10),
            0xdc00 + (i & 0x3FF));
    } else if (i == i) {
      return String.fromCharCode(i);
    } else if (s[1] < ' ') {
      // "a backslash followed by a newline is ignored".
      return '';
    } else {
      return s[1];
    }
  }
669912
def _parse_dash_escaped_line(dash_escaped_line: str) -> str:
        
        text = str()
        regex_dash_escape_prefix = compile('^' + DASH_ESCAPE_PREFIX)
        # if prefixed by a dash escape prefix...
        if regex_dash_escape_prefix.match(dash_escaped_line):
            # remove dash '-' (0x2D) and space ' ' (0x20) prefix
            text += dash_escaped_line[2:]

        return text