def escape_json_formatting(text: str) -> str:
    """
    Replaces characters that might confuse json with escaped characters.

    :param text: Text to escape
    :return: Escaped text string
    """
    # This does not return a one-tuple.
    return (
        text.replace("\\", "\\\\")  # Replace one backslash with two
            .replace('"', r'\"')
    )