import re


def trim_indent(text: str) -> str:
    """ Formats multiline text to remove the minimal/common indent in the text """
    result = text.strip()
    indents = min(len(match.group(0).replace("\t", "    "))
                  for match in re.finditer(r"^\s+", result, re.MULTILINE))
    return re.sub(" {" + str(indents) + "}", "", result)