From 0d91e2dce97703995aafd20ef7a6afdae9bc8d96 Mon Sep 17 00:00:00 2001 From: Cyrille L Date: Thu, 9 Mar 2023 09:35:34 +0100 Subject: [PATCH] fix anchors. Now working. New classes CSS (anchor_target, anchor_link) --- src/var/lib/tyto/program/tyto.py | 4 ++-- src/var/lib/tyto/program/wip.py | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/var/lib/tyto/program/tyto.py b/src/var/lib/tyto/program/tyto.py index 57c2f0b..15df944 100644 --- a/src/var/lib/tyto/program/tyto.py +++ b/src/var/lib/tyto/program/tyto.py @@ -87,7 +87,7 @@ headers = ( # [6] = Check content differently. 't' = startswith #------------------------------------------------------------- words_tags = [ -('>_', '_<', '', '', 'anchors', 'w'), +('>_', '_<', '', '', 'anchors', 'w'), ('*_', '_*', '', '', 'strongs', 'w'), ('+_', '_+', '', '', 'bolds', 'w'), ('/_', '_/', '', '', 'emphasis', 'w'), @@ -117,7 +117,7 @@ tpl_tags = [ #----------------------------------- single_tags = [ ('|', '
'), # New Line -('->', '') # Anchors +('->', '') # Anchors ] # Markers for lists, to check in list content diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index a49a51e..21f769b 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -288,10 +288,10 @@ def wip_abbrs(): ) -#-------------------------------------# -# Get width and height for image # -# from parameter c=, from wip_image() # -#-------------------------------------# +#---------------------------------------# +# Get width and height for image # +# from parameter w/h=, from wip_image() # +#---------------------------------------# def get_wh_image(value): sizes = re.findall(r'(\d+)|(\D+)', value) if not sizes[0][1]: return('%spx'%value) @@ -373,7 +373,7 @@ def wip_images(): ) -#============================================# +#--------------------------------------------# # Get parameters for quote (author, date...) # #--------------------------------------------# def quote_params(qline): @@ -589,8 +589,7 @@ def wip_titles(): title_html = '%s'%(hx, hx, title_cont, hx) article_temp = article_temp.replace(line, title_html) - - + # Remove useless empty lines from article for line in article_temp.rsplit('\n'): if line: