@staticmethod
def align_tags(string: str, n: int) ->str:
    """
        Line-breaks ``string`` and aligns tags starting a column ``n``.
        """
    if not isinstance(n, int):
        raise Exception(f'must be integer:\n    {repr(n)}')
    lines = []
    for line in string.split('\n'):
        if '%!' not in line:
            lines.append(line)
            continue
        location = line.find('%!')
        left = line[:location].rstrip()
        right = line[location:]
        pad = n - len(left)
        if pad < 1:
            pad = 1
        line = left + pad * ' ' + right
        lines.append(line)
    string = '\n'.join(lines)
    return string
