wip: Added module to convert inline-codes

This commit is contained in:
Cyrille L 2022-12-29 23:44:07 +01:00
parent 45c915e421
commit 2d1ccc1ec8
1 changed files with 18 additions and 4 deletions

View File

@ -90,6 +90,9 @@ def wip_article(target):
# Quotes # Quotes
wip_quotes() # Decode B64 and convert wip_quotes() # Decode B64 and convert
# inline_codes
wip_icodes()
print(article_bottom) print(article_bottom)
#=================================# #=================================#
@ -286,9 +289,9 @@ def quote_params(qline):
globals()[tag[1]] = qline.rsplit(' ',1)[1].lstrip() globals()[tag[1]] = qline.rsplit(' ',1)[1].lstrip()
return(True) return(True)
# #==========================#
# INDEV: convert quote in article # Convert quote in article #
# #--------------------------#
def wip_quotes() : def wip_quotes() :
global article_bottom global article_bottom
global author, link, lang, book, date global author, link, lang, book, date
@ -418,3 +421,14 @@ def wip_quotes() :
'Q64.%s.Q64'%line, quote_html 'Q64.%s.Q64'%line, quote_html
) )
#==========================#
# Convert all inline-codes #
#--------------------------#
def wip_icodes():
global article_bottom
matches = re.findall(r'I64.(.*?).I64', article_bottom)
for match in matches:
rep_icode = 'I64.' + match + '.I64'
src_icode = tyto.b64("Decode", match, 'I64.', '.I64')
article_bottom = article_bottom.replace(rep_icode, src_icode)