swh:1:snp:02443124ed4ee0d8d724fefd38bf9b271361cc09
Tip revision: 2f39f190cbe8fc85d0141288ae6ff107bfe475ec authored by Jan-Michael Rye on 02 October 2023, 09:43:41 UTC
Add options to `chemfeat configure`
Add options to `chemfeat configure`
Tip revision: 2f39f19
markdown.py
#!/usr/bin/env python3
'''
Functions for generating Markdown files.
'''
_SPECIAL_CHARS = r'\`*_{}[]<>()+-.!|'
_TRANS_TABLE = str.maketrans({char: f'\\{char}' for char in _SPECIAL_CHARS})
def escape(text):
'''
Escape special symbols in Markdown text.
'''
return text.translate(_TRANS_TABLE)