import re


def post_process_iframes_to_markdown(content, iframes_dict) -> str:
    """Locate, and replace placeholder ID with iframe code

    Parameters
    ----------
    content : str
        A string of HTML code to be parsed for iframe tags.
    iframes_dict: dict
        Dictionary where the key is the unique placeholder string, the value is the iframe beautiful soup tag object

    Returns
    -------
    content: str
        The raw_content with iframe code replacing the unique placeholder string.

    """
    for key, value in iframes_dict.items():
        search_for = rf'\ *{key}'  # including leading spaces to leave a blank line
        replace_with = f'\n{value}\n'  # new line either side of html code is required for some readers
        content = re.sub(search_for, replace_with, content)

    return content