File: //lib/python3/dist-packages/docutils/transforms/__pycache__/misc.cpython-312.pyc
�
�dd � �f � d Z dZddlmZ ddlmZ G d� de� Z G d� de� Z G d � d
e� Zy)z
Miscellaneous transforms.
�reStructuredText� )�nodes)� Transformc � � e Zd ZdZdZd� Zy)�CallBacka�
Inserts a callback into a document. The callback is called when the
transform is applied, which is determined by its priority.
For use with `nodes.pending` elements. Requires a ``details['callback']``
entry, a bound method or function which takes one parameter: the pending
node. Other data can be stored in the ``details`` attribute or in the
object hosting the callback method.
i� c �| � | j } |j d |� |j j |� y )N�callback)� startnode�details�parent�remove)�self�pendings �:/usr/lib/python3/dist-packages/docutils/transforms/misc.py�applyzCallBack.apply s0 � ��.�.��#����
�#�G�,������g�&� N��__name__�
__module__�__qualname__�__doc__�default_priorityr � r r r r s � �� ��'r r c � � e Zd ZdZdZd� Zy)�ClassAttributez|
Move the "class" attribute specified in the "pending" node into the
immediately following non-comment element.
�� c � � | j }|j }|}|r�t |j |� dz t |� � D ]r }|| }t |t j � st |t j � r�=|dxx |j d z
cc<