From 418254a45f88bf9d56f5603297a5f80215833d33 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Mon, 26 Dec 2022 17:04:22 +0100 Subject: [PATCH] check: fix for searching image:, brut: in header --- src/var/lib/tyto/program/check.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 1a1b305..54b3d15 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -528,6 +528,7 @@ def check_content(post_bottom): # Check for _image:NAME from content in header #--------------------------------------------- + print(article_header) for ln, line in enumerate(post_bottom): for tag in tyto.content_tags: htag_found = False @@ -535,9 +536,10 @@ def check_content(post_bottom): tag_id = line.rsplit(':', 1)[1].rsplit(' ')[0] htag = tag[1: len(tag)] - if not re.search(r'^%s\s+\b%s\b|%s\b%s\b'%( + rexp = r'|%s\s+\b%s\b|%s\b%s\b'%( htag, tag_id, htag, tag_id - ), article_header): + ) + if not re.search(rexp, article_header): tyto.exiting("10", "%s %s"%(htag, tag_id), True)