AlertRuleFactory
ClassSource
AlertRuleFactory(
titles: Sequence[str] | None = None,
icons: Mapping[str, str] | None = None,
class_prefix: str = "markdown-alert",
*,
parse_nested: bool = True,
match_case_sensitive: bool = False
)
Identifies blockquote tokens and transforms them to alert tokens.
Arguments
Requires
| Name | Type | Required | |
|---|---|---|---|
titles | Sequence[str] | None | The allowed titles that would be used to detect the alert box. If not specified, will use the default list: | |
icons | Mapping[str, str] | None | The icon storage. It is a mapping from the title to the icon SVG text. | |
class_prefix | str | The prefix of the class name when the alert box is produced. | |
parse_nested | bool | A flag. If specified, will render the nested alert boxes. | |
match_case_sensitive | bool | A flag. If specified, will match the case of the identifier (title) when rendering the alert boxes. |
Methods
get_rule
v_1: Callable[[StateCore], None] = self.get_rule()
Produce the rule plugin of the MarkdownIt.
Returns
| Name | Type | |
|---|---|---|
v_1 | Callable[[StateCore], None] | The rule function that will be used as the plugin of the Markdown parser. |
Properties
pattern
pattern: Pattern[str] = self.pattern
The pattern used for matching the alert boxes in the Markdown text.