diff --git a/src/var/lib/tyto/program/check.py b/src/var/lib/tyto/program/check.py index cf0f639..3eaccf3 100644 --- a/src/var/lib/tyto/program/check.py +++ b/src/var/lib/tyto/program/check.py @@ -529,10 +529,16 @@ def check_content(post_bottom): # Check for _image:NAME from content in header #--------------------------------------------- for ln, line in enumerate(post_bottom): - if line.startswith(content_tags): - tag_id = line.rsplit(':', 1)[1].rsplit(' ')[0] - if not re.search(r'^' + tag + '\s|' + tag_id, article_header): - tyto.exiting("10", "%s %s"%(tag, tag_id), True) + for tag in tyto.content_tags: + htag_found = False + if line.startswith(tag): + 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'%( + htag, tag_id, htag, tag_id + ), article_header): + tyto.exiting("10", "%s %s"%(htag, tag_id), True) #===============================================# diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index 57b1da4..bddd878 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -153,6 +153,9 @@ quote_tags = [ ('_lang:', 'lang') ] +# Tags to check for header in content +content_tags = ("_image:", '_brut:') + #=======# # TOOLS #