from typing import Dict
import re


def mrepr(content: str, metadata: Dict[str, str]) -> str:
    """Replaces {{metadata}} by keypair: value"""
    for key, value in metadata.items():
        content = re.sub(fr"{{{{\s?{key}\s?}}}}", value, content, flags=re.I)
    return content