docs: Fix warnings in re pattern and update py-gfm version

1. wipe out syntaxwarnings of "invalid escape sequence '\s'"
2. update py-gfm version to fit python3.8+

Signed-off-by: Ju Nan <junan76@163.com>
This commit is contained in:
Ju Nan authored and KevinOConnor committed 2026-04-01 11:50:21 -04:00
1 parent 0d1445a723
commit b0e6ca45fc
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -6,5 +6,5 @@ mkdocs-simple-hooks==0.1.3
mkdocs-exclude==1.0.2
mdx-truly-sane-lists==1.2
mdx-breakless-lists==1.0.1
py-gfm==1.0.2
py-gfm==2.0.0
markdown==3.3.7
+2 -2
View File
@@ -21,11 +21,11 @@ def transform(markdown: str, page, config, files):
for i in range(len(lines)):
line_out = lines[i]
in_code_block = (in_code_block +
len(re.findall("\s*[`]{3,}", line_out))) % 2
len(re.findall(r"\s*[`]{3,}", line_out))) % 2
if not in_code_block:
line_out = line_out.replace('](../',
f"]({config['repo_url']}blob/master/")
line_out = re.sub("\\\s*$", "<br>", line_out)
line_out = re.sub(r"\\\s*$", "<br>", line_out)
# check that lists at level 0 are not indented
# (no space before *|-|1.)
if re.match(r"^[^-*0-9 ]", line_out):