Fix regex at check to search some specific characters in NAME

This commit is contained in:
Cyrille L 2023-04-07 16:36:46 +02:00
parent ba9961e357
commit e6e02ea30e
1 changed files with 7 additions and 6 deletions

View File

@ -519,7 +519,7 @@ def check_3lines(tag, ln, line):
logs.out("2", 'L=%s. "%s: %s" > %s'%(
ln, tag, langs.site.name, db.uri_file
), False)
post_err = True
post_err = True
# abbr:
elif tag == "abbr":
@ -531,7 +531,7 @@ def check_3lines(tag, ln, line):
check_snpic(name)
return
elif not isin(r'\b%s\b'%(opt_tags_post_name[tag]%name), post_bottom):
elif not isin("%s"%(opt_tags_post_name[tag]%name), post_bottom):
logs.out("12", '"%s" > %s'%(
opt_tags_post_name[tag]%name, db.uri_file
), False)
@ -587,10 +587,11 @@ def check_3lines(tag, ln, line):
# Find in post_bottom #
#---------------------#
def isin(term, post_file):
for line in post_file.rsplit('\n'):
if re.search(term, line):
return(True)
return(False)
paterm = re.escape(term)
if re.search(paterm, post_file): return(True)
else: return(False)
#===================================#