simplify rst tag management

Closes #1
This commit is contained in:
Vincent Poulailleau 2019-11-19 10:30:07 +01:00
parent e61eaaa5cc
commit b13763a320

View File

@ -72,27 +72,7 @@ class PoItem:
text = re.sub(r"``(.*?)``", r"« \1 »", text)
text = re.sub(r"\"(.*?)\"", r"« \1 »", text)
text = re.sub(r":pep:`(.*?)`", r"PEP \1", text)
for term in (
"abbr",
"attr",
"c:func",
"c:type",
"class",
"const",
"data",
"dfn",
"exc",
"file",
"func",
"kbd",
"keyword",
"meth",
"mod",
"ref",
"source",
"term",
):
text = re.sub(rf":{term}:`(.*?)`", r"« \1 »", text)
text = re.sub(r":[a-z:]+:`(.+?)`", r"« \1 »", text)
text = re.sub(r"\*\*(.*?)\*\*", r"« \1 »", text)
text = re.sub(
r"\*(.*?)\*", r"« \1 »", text