fix anchors. Now working. New classes CSS (anchor_target, anchor_link)

This commit is contained in:
Cyrille L 2023-03-09 09:35:34 +01:00
parent 36520d9ab6
commit 0d91e2dce9
2 changed files with 8 additions and 9 deletions

View File

@ -87,7 +87,7 @@ headers = (
# [6] = Check content differently. 't' = startswith # [6] = Check content differently. 't' = startswith
#------------------------------------------------------------- #-------------------------------------------------------------
words_tags = [ words_tags = [
('>_', '_<', '<a class="anchor" href="#%s">', '</a>', 'anchors', 'w'), ('>_', '_<', '<a class="anchor_link" href="#%s">', '</a>', 'anchors', 'w'),
('*_', '_*', '<strong class="strong">', '</strong>', 'strongs', 'w'), ('*_', '_*', '<strong class="strong">', '</strong>', 'strongs', 'w'),
('+_', '_+', '<b class="bold">', '</b>', 'bolds', 'w'), ('+_', '_+', '<b class="bold">', '</b>', 'bolds', 'w'),
('/_', '_/', '<em class="em">', '</em>', 'emphasis', 'w'), ('/_', '_/', '<em class="em">', '</em>', 'emphasis', 'w'),
@ -117,7 +117,7 @@ tpl_tags = [
#----------------------------------- #-----------------------------------
single_tags = [ single_tags = [
('|', '<br />'), # New Line ('|', '<br />'), # New Line
('->', '<a href="%s"></a>') # Anchors ('->', '<a class="anchor_target" id="%s"></a>') # Anchors
] ]
# Markers for lists, to check in list content # Markers for lists, to check in list content

View File

@ -288,10 +288,10 @@ def wip_abbrs():
) )
#-------------------------------------# #---------------------------------------#
# Get width and height for image # # Get width and height for image #
# from parameter c=, from wip_image() # # from parameter w/h=, from wip_image() #
#-------------------------------------# #---------------------------------------#
def get_wh_image(value): def get_wh_image(value):
sizes = re.findall(r'(\d+)|(\D+)', value) sizes = re.findall(r'(\d+)|(\D+)', value)
if not sizes[0][1]: return('%spx'%value) if not sizes[0][1]: return('%spx'%value)
@ -373,7 +373,7 @@ def wip_images():
) )
#============================================# #--------------------------------------------#
# Get parameters for quote (author, date...) # # Get parameters for quote (author, date...) #
#--------------------------------------------# #--------------------------------------------#
def quote_params(qline): def quote_params(qline):
@ -589,8 +589,7 @@ def wip_titles():
title_html = '<h%s class="title_%s">%s</h%s>'%(hx, hx, title_cont, hx) title_html = '<h%s class="title_%s">%s</h%s>'%(hx, hx, title_cont, hx)
article_temp = article_temp.replace(line, title_html) article_temp = article_temp.replace(line, title_html)
# Remove useless empty lines from article # Remove useless empty lines from article
for line in article_temp.rsplit('\n'): for line in article_temp.rsplit('\n'):
if line: if line: