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

Method __init__

markdown/inlinepatterns.py:198–213  ·  view source on GitHub ↗

Create an instant of an inline pattern. Arguments: pattern: A regular expression that matches a pattern. md: An optional pointer to the instance of `markdown.Markdown` and is available as `self.md` on the class instance.

(self, pattern: str, md: Markdown | None = None)

Source from the content-addressed store, hash-verified

196 md: Markdown | None
197
198 def __init__(self, pattern: str, md: Markdown | None = None):
199 """
200 Create an instant of an inline pattern.
201
202 Arguments:
203 pattern: A regular expression that matches a pattern.
204 md: An optional pointer to the instance of `markdown.Markdown` and is available as
205 `self.md` on the class instance.
206
207
208 """
209 self.pattern = pattern
210 self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern,
211 re.DOTALL | re.UNICODE)
212
213 self.md = md
214
215 def getCompiledRegExp(self) -> re.Pattern:
216 """ Return a compiled regular expression. """

Callers 4

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected