mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-06 16:56:42 +08:00
fix(py): fix SyntaxWarning: invalid escape sequence
This commit is contained in:
parent
520d8ee390
commit
04d9810324
@ -95,7 +95,7 @@ def compose_page(relative_path, definitions):
|
||||
|
||||
while True:
|
||||
new_text = scrub_comments(text)
|
||||
new_text = re.sub("\$\$", "$$$$", new_text)
|
||||
new_text = re.sub(r"\$\$", "$$$$", new_text)
|
||||
new_text = apply_template(new_text, definitions)
|
||||
|
||||
if new_text == text:
|
||||
|
||||
@ -142,10 +142,10 @@ def to_html(text):
|
||||
return definitions
|
||||
|
||||
def clean_text(text):
|
||||
text = re.sub("<(?P<tag>[^> ]+)[^>]*>(.*?)</(?P=tag)>", "\g<2>", text)
|
||||
text = re.sub("<(?P<tag>[^> ]+)[^>]*>(.*?)</(?P=tag)>", "\g<2>", text)
|
||||
text = re.sub("<(?P<tag>[^> ]+)[^>]*>(.*?)</(?P=tag)>", r"\g<2>", text)
|
||||
text = re.sub("<(?P<tag>[^> ]+)[^>]*>(.*?)</(?P=tag)>", r"\g<2>", text)
|
||||
text = re.sub("—", "-", text)
|
||||
text = re.sub("\$cxx", "C++", text)
|
||||
text = re.sub(r"\$cxx", "C++", text)
|
||||
return text
|
||||
|
||||
class CxxRenderer(mistune.Renderer):
|
||||
@ -188,7 +188,7 @@ class CxxRenderer(mistune.Renderer):
|
||||
code = re.sub("</?em>", "", code)
|
||||
|
||||
if lang == "comment":
|
||||
code = re.sub("^(.)", "// \g<1>", code, flags = re.MULTILINE)
|
||||
code = re.sub("^(.)", r"// \g<1>", code, flags = re.MULTILINE)
|
||||
code = re.sub("^$", "//", code, flags = re.MULTILINE)
|
||||
return self._join_paragraph() + code + "\n"
|
||||
else:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user