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

Method __init__

markdown/inlinepatterns.py:226–241  ·  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

224 md: Markdown | None
225
226 def __init__(self, pattern: str, md: Markdown | None = None):
227 """
228 Create an instant of an inline pattern.
229
230 Arguments:
231 pattern: A regular expression that matches a pattern.
232 md: An optional pointer to the instance of `markdown.Markdown` and is available as
233 `self.md` on the class instance.
234
235
236 """
237 self.pattern = pattern
238 self.compiled_re = re.compile(r"^(.*?)%s(.*)$" % pattern,
239 re.DOTALL | re.UNICODE)
240
241 self.md = md
242
243 def getCompiledRegExp(self) -> re.Pattern:
244 """ Return a compiled regular expression. """

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected