Files
Igor20264 516abe7b83
Python application / build (push) Has been cancelled
BigUpdate
2026-09-03 10:44:08 +03:00

19 lines
444 B
Python

from marko.inline import InlineElement
from re import Match
class Reference(InlineElement):
"""Represents Reference element
Syntax: @Type:label
Label is only word characters so trailing punctuation in
«@Рисунок:id,» or «(@Рисунок:id)» is not swallowed.
"""
pattern = r"@(\w+):(\w+)"
def __init__(self, match: Match[str]):
self.type = match.group(1)
self.name = match.group(2)