19 lines
444 B
Python
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)
|