def markdown_escape_filter(text):
    """Escape special characters in Markdown."""
    return text.replace("\\", "\\\\").replace("`", "\\`").replace(
        "*", "\\*").replace("_", "\\_").replace("{", "\\{").replace(
            "}", "\\}").replace("[", "\\[").replace("]", "\\]").replace(
                "(", "\\(").replace(")", "\\)").replace("#", "\\#").replace(
                    "+", "\\+").replace("-",
                                        "\\-").replace(".", "\\.").replace(
                                            "!", "\\!").replace("|", "\\|")