fix for images

html : image width
gmi: image link
This commit is contained in:
quenousimporte 2026-08-17 10:39:33 +02:00
parent 84843988fd
commit c6c65c8c32
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ htmltemplate = """<!DOCTYPE html>
html {{ margin: 20px; }} html {{ margin: 20px; }}
body {{ margin: auto; max-width: 800px; text-align: justify; }} body {{ margin: auto; max-width: 800px; text-align: justify; }}
audio {{ height: 14px}} audio {{ height: 14px}}
img {{ width: 100% }}
</style> </style>
</head> </head>
<body>{body}</body></html>""" <body>{body}</body></html>"""
@ -30,7 +31,7 @@ def md2html(md):
def md2gmi(md): def md2gmi(md):
gmi = md gmi = md
gmi = re.sub(r'\[(.*)\]\((.*)\)', r'\n=> \2 \1', gmi) gmi = re.sub(r'!?\[(.*)\]\((.*)\)', r'\n=> \2 \1', gmi)
gmi = gmi.replace('* * *', '---') gmi = gmi.replace('* * *', '---')
gmi = re.sub(r'^\*(.*)\*$', r'> \1', gmi, flags=re.MULTILINE) gmi = re.sub(r'^\*(.*)\*$', r'> \1', gmi, flags=re.MULTILINE)
gmi = re.sub(r'\*(.*)\*', r'\1', gmi) gmi = re.sub(r'\*(.*)\*', r'\1', gmi)