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

@ -89,6 +89,9 @@ def wip_article(target):
# Quotes
wip_quotes() # Decode B64 and convert
# inline_codes
wip_icodes()
print(article_bottom)
@ -286,9 +289,9 @@ def quote_params(qline):
globals()[tag[1]] = qline.rsplit(' ',1)[1].lstrip()
return(True)
#
# INDEV: convert quote in article
#
#==========================#
# Convert quote in article #
#--------------------------#
def wip_quotes() :
global article_bottom
global author, link, lang, book, date
@ -417,4 +420,15 @@ def wip_quotes() :
article_bottom = article_bottom.replace(
'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)