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
2026-03-23 10:59:16 +08:00
committed by KevinOConnor
parent 0d1445a723
commit b0e6ca45fc
2 changed files with 3 additions and 3 deletions

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

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):