check: added search in header when '_image:NAME' in content

This commit is contained in:
Cyrille L 2022-12-26 11:14:28 +01:00
parent f279583d11
commit 4d285c4d27
2 changed files with 11 additions and 0 deletions

View File

@ -526,6 +526,16 @@ def check_content(post_bottom):
post_err = True
# Check for _image:NAME from content in header
#---------------------------------------------
for ln, line in enumerate(post_bottom):
if line.startswith('_image:'):
image_id = line.rsplit(':', 1)[1].rsplit(' ')[0]
print(article_header)
if not re.search(r'^image:\s|%s'%image_id, article_header):
tyto.exiting("10", "image: %s"%image_id, True)
#===============================================#
# Create new article's database at each check ! #
#-----------------------------------------------#

View File

@ -449,6 +449,7 @@ def exiting(nbr, value, out):
'7' : ':< Article is \033[1;31mnot valid yet\033[0;0m',
'8' : ':< tags "%s" \033[1;31mnot paired\033[0;0m'%value,
'9' : ':D Article has changed (wip is old)',
'10' : ':< \033[1;31mUnused "%s"\033[0;0m in article\'s header'%value,
'20' : ':D Article already up-to-date on: %s'%value,
'21' : ':D Article is valid and ready to wip',
'255' : ':| Maybe later...'