def css_unescape(content, string=False):
    """
    Unescape CSS value.

    Strings allow for spanning the value on multiple strings by escaping a new line.
    """

    def replace(m):
        """Replace with the appropriate substitute."""

        if m.group(1):
            codepoint = int(m.group(1)[1:], 16)
            if codepoint == 0:
                codepoint = UNICODE_REPLACEMENT_CHAR
            value = util.uchr(codepoint)
        elif m.group(2):
            value = m.group(2)[1:]
        elif m.group(3):
            value = '\ufffd'
        else:
            value = ''

        return value

    return (RE_CSS_ESC if not string else RE_CSS_STR_ESC).sub(replace, content)
def css_unescape ( content , string = False ) : def replace ( m ) : if m . group ( 1 ) : codepoint = int ( m . group ( 1 ) [ 1 : ] , 16 ) if codepoint == 0 : codepoint = UNICODE_REPLACEMENT_CHAR value = util . uchr ( codepoint ) elif m . group ( 2 ) : value = m . group ( 2 ) [ 1 : ] elif m . group ( 3 ) : value = '\ufffd' else : value = '' return value return ( RE_CSS_ESC if not string else RE_CSS_STR_ESC ) . sub ( replace , content )
Unescape CSS value.

    Strings allow for spanning the value on multiple strings by escaping a new line.