Merge 04d98103249f749613a0254c2c7fd535184c8843 into 520d8ee39037c9c94aa6e708a4fd6c0fa313ae80

This commit is contained in:
Eisuke Kawashima 2025-06-07 04:02:26 +09:00 committed by GitHub
commit fa7342d1d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -95,7 +95,7 @@ def compose_page(relative_path, definitions):
while True: while True:
new_text = scrub_comments(text) 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) new_text = apply_template(new_text, definitions)
if new_text == text: if new_text == text:

View File

@ -142,10 +142,10 @@ def to_html(text):
return definitions return definitions
def clean_text(text): def clean_text(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)>", "\g<2>", text) text = re.sub("<(?P<tag>[^> ]+)[^>]*>(.*?)</(?P=tag)>", r"\g<2>", text)
text = re.sub("&mdash;", "-", text) text = re.sub("&mdash;", "-", text)
text = re.sub("\$cxx", "C++", text) text = re.sub(r"\$cxx", "C++", text)
return text return text
class CxxRenderer(mistune.Renderer): class CxxRenderer(mistune.Renderer):
@ -188,7 +188,7 @@ class CxxRenderer(mistune.Renderer):
code = re.sub("</?em>", "", code) code = re.sub("</?em>", "", code)
if lang == "comment": 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) code = re.sub("^$", "//", code, flags = re.MULTILINE)
return self._join_paragraph() + code + "\n" return self._join_paragraph() + code + "\n"
else: else: