check _TAGS:NAME from content in header. Now fix

This commit is contained in:
Cyrille L 2022-12-29 12:17:13 +01:00
parent 418254a45f
commit 1bb3df0d26
1 changed files with 13 additions and 8 deletions

View File

@ -526,20 +526,25 @@ def check_content(post_bottom):
post_err = True post_err = True
# Check for _image:NAME from content in header # Check for all match _TAGS:NAME from content in header
#--------------------------------------------- #------------------------------------------------------
print(article_header) print(article_header)
for ln, line in enumerate(post_bottom): for ln, line in enumerate(post_bottom):
for tag in tyto.content_tags: for tag in tyto.content_tags:
htag_found = False htag = tag[1: len(tag)]
if line.startswith(tag): if line.startswith(tag):
tag_id = line.rsplit(':', 1)[1].rsplit(' ')[0] 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'%( if not match:
htag, tag_id, htag, tag_id
)
if not re.search(rexp, article_header):
tyto.exiting("10", "%s %s"%(htag, tag_id), True) tyto.exiting("10", "%s %s"%(htag, tag_id), True)