MCPcopy Create free account
hub / github.com/executablebooks/markdown-it-py / push

Method push

markdown_it/ruler.py:176–189  ·  view source on GitHub ↗

Push new rule to the end of chain. :param ruleName: new rule will be added to the end of chain. :param fn: new rule function. :param options: new rule options (not mandatory).

(
        self, ruleName: str, fn: RuleFuncTv, options: RuleOptionsType | None = None
    )

Source from the content-addressed store, hash-verified

174 self.__cache__ = None
175
176 def push(
177 self, ruleName: str, fn: RuleFuncTv, options: RuleOptionsType | None = None
178 ) -> None:
179 """Push new rule to the end of chain.
180
181 :param ruleName: new rule will be added to the end of chain.
182 :param fn: new rule function.
183 :param options: new rule options (not mandatory).
184
185 """
186 self.__rules__.append(
187 Rule[RuleFuncTv](ruleName, True, fn, (options or {}).get("alt", []))
188 )
189 self.__cache__ = None
190
191 def enable(
192 self, names: str | Iterable[str], ignoreInvalid: bool = False

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected