def escapejs(value):
    """Hex encodes characters for use in JavaScript strings."""
    for bad, good in _js_escapes:
        value = value.replace(bad, good)
    return value
Hex encodes characters for use in JavaScript strings.
v2ex/templatetags/filters.py