def escape_yaml_doublequoted(string):
    """Escape the content of a double-quoted YAML string.

    Parameters
    ----------
    string : `str`
        A string.

    Returns
    -------
    escaped_string : `str`
        A string escaped so it can be safely inserted into a double-quoted
        YAML string.

    Notes
    -----
    To escape a double-quoted YAML string:

    - Replace ``\\`` with ``\\\\``.
    - Replace ``"`` with ``"\\``.
    """
    return string.replace('\\', '\\\\').replace('"', '\\"')
