Files
md_to_gost/md2gost/extended_markdown/image.py
T
Igor20264 516abe7b83
Python application / build (push) Has been cancelled
BigUpdate
2026-09-03 10:44:08 +03:00

16 lines
369 B
Python

import re
from marko.inline import Image as Image_
class Image(Image_):
override = True
def __init__(self, match):
super().__init__(match)
self.unique_name = None
if self.title and (m := re.match(r"\%(\w+)( (.+))?", self.title)):
self.unique_name = m.group(1)
self.title = (m.group(3) or "").strip() or None