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

Method __init__

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

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