�
K�g` � � � d Z ddlmZ ddlmc mZ ddlmZmZm Z ddl
mZ erddlm
Z
ddlmZ G d � d
e� � Z G d� d� � ZdS )
a�
The block parser handles basic parsing of Markdown blocks. It doesn't concern
itself with inline elements such as `**bold**` or `*italics*`, but rather just
catches blocks, lists, quotes, etc.
The `BlockParser` is made up of a bunch of `BlockProcessors`, each handling a
different type of block. Extensions may add/replace/remove `BlockProcessors`
as they need to alter how Markdown blocks are parsed.
� )�annotationsN)�
TYPE_CHECKING�Iterable�Any� )�util)�Markdown)�BlockProcessorc �* � e Zd ZdZdd�Zdd�Zd
d �Zd
S )�Statea� Track the current and nested state of the parser.
This utility class is used to track the state of the `BlockParser` and
support multiple levels if nesting. It's just a simple API wrapped around
a list. Each time a state is set, that state is appended to the end of the
list. Each time a state is reset, that state is removed from the end of
the list.
Therefore, each time a state is set for a nested block, that state must be
reset when we back out of that level of nesting or the state could be
corrupted.
While all the methods of a list object are available, only the three
defined below need be used.
�stater c �0 � | � |� � dS )z Set a new state. N)�append��selfr
s �d/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/markdown/blockparser.py�setz State.set; s � ����E������ �return�Nonec �. � | � � � dS )z% Step back one step in nested state. N)�pop)r s r �resetzState.reset? s � ����
�
�
�
�
r �boolc �<