diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index 696f48c..f9e4fb2 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -214,17 +214,21 @@ def wip_images(): image_link = '%s' image_show = '%s' + # Check each line for ln, line in enumerate(article_bottom.rsplit('\n')): + # match line if line.startswith('_image:'): values = line.rsplit(' ') - #print(values) + # search match tag in DB for i in range(1, uniq_images + 1): image = 'image_%s'%i target = width = height = False set_css = tyto.domain_css + '_image' + imag_html = '' if eval(image)[0] == values[0]: + # Get parameters from match line for value in values: if 't=' in value: target = value.rsplit('=',1)[1] @@ -249,10 +253,12 @@ def wip_images(): else: style = '' + # set from parameter image_src = image_show%( set_css, eval(image)[1], eval(image)[2], style ) + # Set link for image if target: image_tgt = image_link%( set_css, image_target, eval(image)[2], '%s' @@ -260,8 +266,10 @@ def wip_images(): else: image_tgt = '%s' + # Set HTML to replace line number image_html = image_tgt%image_src - - article_bottom = article_bottom.replace( - article_bottom.rsplit('\n')[ln], image_html - ) + + article_bottom = article_bottom.replace( + article_bottom.rsplit('\n')[ln], image_html + ) +