diff --git a/setup.py b/setup.py index 45d9d9b..86987f1 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="md2tgmd", - version="0.2.8", + version="0.2.9", description="md2tgmd is a Markdown to Telegram-specific-markdown converter.", long_description=Path("README.md").open(encoding="utf-8").read(), long_description_content_type="text/markdown", diff --git a/src/md2tgmd.py b/src/md2tgmd.py index a6b3780..10ce3e1 100644 --- a/src/md2tgmd.py +++ b/src/md2tgmd.py @@ -173,6 +173,7 @@ def escape(text, flag=0): text = re.sub(r"`", '\`', text) text = re.sub(r"\@\<\@", '\`', text) text = re.sub(r"\@\-\>\@", '`', text) + text = re.sub(r"\s`\\`\s", ' `\\\\\` ', text) # text = replace_all(text, r"`.*?`{1,2}|(`)", escapebackquoteincode) # text = re.sub(r"`", '\`', text) @@ -264,6 +265,11 @@ def escape(text, flag=0): (\`) - `Path.open()` 方法打开了 `README.md` 文件,并指定了编码为 `"utf-8"`。 + +为了匹配实际的点号,需要使用反斜杠 `\` 进行转义。 + +3. `(` + ''' if __name__ == '__main__':