Skip to content

Commit

Permalink
fix regex for meta robots noindex directive
Browse files Browse the repository at this point in the history
  • Loading branch information
cicirello committed Oct 5, 2023
1 parent bffb9f9 commit 8fcb389
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion generatesitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def hasMetaRobotsNoindex(f) :
m = re.search("<body>", contents, flags=re.I)
all_meta_tags = RE_META_TAG.findall(contents, endpos=m.start()) if m else RE_META_TAG.findall(contents)
for tag in all_meta_tags :
if re.search("name\s*=\s*\"\s*robots", tag, flags=re.I) and re.search("content\s*=\s*\".*noindex", tag, flags=re.I) :
if re.search("name\\s*=\\s*\"\\s*robots", tag, flags=re.I) and re.search("content\\s*=\\s*\".*noindex", tag, flags=re.I) :
return True
return False
except OSError:
Expand Down

0 comments on commit 8fcb389

Please sign in to comment.