Skip to content

Commit e9172da

Browse files
committed
配置PG 13 更新匹配<body>的正则表达式
1 parent 5fa3c42 commit e9172da

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/add_edit_link.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ def process(file, current_version, master_version, all_versions):
6868
fin=open(file,"r",encoding='GBK')
6969
content=fin.read()
7070
content=content.replace('CONTENT="text/html; charset=gbk"','CONTENT="text/html; charset=utf-8"')
71-
else:
71+
elif current_version in ['10','11','12']:
7272
patternInsertPos=re.compile(r'.*<body>',re.S)
7373
patternInsertPos2=re.compile(r'.*</body>',re.S)
7474
fin=open(file,"r",encoding='UTF-8')
7575
content=fin.read()
76+
else:
77+
patternInsertPos=re.compile(r'.*<body\s+[^>]*>',re.S)
78+
patternInsertPos2=re.compile(r'.*</body>',re.S)
79+
fin=open(file,"r",encoding='UTF-8')
80+
content=fin.read()
7681
fout=open(os.path.join(htmlOutputDir,filename),"w",encoding='UTF-8')
7782

7883
sgmlfile=html2sgmlDict.get(filename.lower())

0 commit comments

Comments
 (0)