def _is_quoted_string(string):
    """
    checks if the string parameter is surrounded in quotes, which is how
    strings arrive from the template tags.
    """
    if len(string) < 2:
        return False
    return string[0] == string[-1] and string[0] in ('"', "'")