diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index 54b3d15..2f331b4 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -526,20 +526,25 @@ def check_content(post_bottom): post_err = True - # Check for _image:NAME from content in header - #--------------------------------------------- + # Check for all match _TAGS:NAME from content in header + #------------------------------------------------------ print(article_header) for ln, line in enumerate(post_bottom): for tag in tyto.content_tags: - htag_found = False + htag = tag[1: len(tag)] + if line.startswith(tag): tag_id = line.rsplit(':', 1)[1].rsplit(' ')[0] - htag = tag[1: len(tag)] + + match = False + for hline in post_header: + if hline.startswith('image:'): + htag_id = hline.rsplit(':', 1)[1].lstrip() + if htag_id == tag_id: + match = True + break - rexp = r'|%s\s+\b%s\b|%s\b%s\b'%( - htag, tag_id, htag, tag_id - ) - if not re.search(rexp, article_header): + if not match: tyto.exiting("10", "%s %s"%(htag, tag_id), True)