def sugartex_preprocess(source: str) -> str:
    """
    Preprocess text for SugarTeX Pandoc filter.
    Replaces 'ˎ' with `$` (except `\ˎ`), replaces `\ˎ` with `ˎ`
    """
    rep = {r'\ˎ': 'ˎ', 'ˎ': '$'}
    return re.sub(r'\\ˎ|ˎ', lambda m: rep[m.group(0)], source)
Preprocess text for SugarTeX Pandoc filter.
    Replaces 'ˎ' with `$` (except `\ˎ`), replaces `\ˎ` with `ˎ`