Fixes : line number mismatch with icode check. + wip_images()

This commit is contained in:
Cyrille L 2023-04-06 15:59:19 +02:00
parent 2f0b03c656
commit c2c1a4c8e1
2 changed files with 15 additions and 6 deletions

View File

@ -372,7 +372,7 @@ def if_icodes_bcodes_quotes(post_bottom):
icode_m2 = line.count(tyto.words_tags[9][1]) icode_m2 = line.count(tyto.words_tags[9][1])
if icode_m1 != icode_m2: if icode_m1 != icode_m2:
logs.out("8", 'L=%s. icode "%s" + "%s" > %s'%( logs.out("8", 'L=%s. icode "%s" + "%s" > %s'%(
ln + ln_header, ln + 1 + ln_header,
tyto.words_tags[9][0], tyto.words_tags[9][1], tyto.words_tags[9][0], tyto.words_tags[9][1],
db.uri_file db.uri_file
), False ), False

View File

@ -65,8 +65,11 @@ def manage(target):
'stats' : stats.manage 'stats' : stats.manage
} }
do[target]('wip') try:
return do[target]('wip')
return
except:
logs.out("28", '%s + %s'%(args.action, target), True)
# Per article with target # Per article with target
@ -396,8 +399,14 @@ def get_wh_image(value):
def wip_images(): def wip_images():
if db.uniq_images == 0: return if db.uniq_images == 0: return
image_link = '<a class="%s" href="%s">%s</a>' image_link = \
image_show = '<img class="%s" src="%s" alt="%s" title="%s"%s />' '<a class="%s"\n' + \
' href="%s">%s</a>'
image_show = \
'<img class="%s"\n' + \
' src="%s"\n' + \
' alt="%s"\n' + \
' title="%s"%s />'
# Check each line # Check each line
for ln, line in enumerate(post_bottom.rsplit('\n')): for ln, line in enumerate(post_bottom.rsplit('\n')):
@ -461,7 +470,7 @@ def wip_images():
# Set HTML to replace line number # Set HTML to replace line number
image_html = image_tgt%image_src image_html = image_tgt%image_src
replace_in_post(post_bottom.rsplit('\n')[ln], replace_in_post(line,
image_html image_html
) )