def strike_through(text):
    """Replace ~~foo~~ with <s>foo</s> to support strike-through in output"""
    text = text.split('\n')
    for line_i, line in enumerate(text):
        if '~~' not in line:
            continue
        line = line.split('~~')
        parts = []
        for part_i, part in enumerate(line):
            if part_i % 2 == 0:
                parts.append(part)
            else:
                parts.append("<s>%s</s>" % part)
        text[line_i] = ''.join(parts)
    return '\n'.join(text)