MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / AbbrInlineProcessor

Class AbbrInlineProcessor

markdown/extensions/abbr.py:184–195  ·  view source on GitHub ↗

Abbreviation inline pattern.

Source from the content-addressed store, hash-verified

182
183@deprecated("This class will be removed in the future; use `AbbrTreeprocessor` instead.")
184class AbbrInlineProcessor(InlineProcessor):
185 """ Abbreviation inline pattern. """
186
187 def __init__(self, pattern: str, title: str):
188 super().__init__(pattern)
189 self.title = title
190
191 def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int, int]:
192 abbr = etree.Element('abbr')
193 abbr.text = AtomicString(m.group('abbr'))
194 abbr.set('title', self.title)
195 return abbr, m.start(0), m.end(0)
196
197
198def makeExtension(**kwargs): # pragma: no cover

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected