Your IP : 216.73.216.213
B
!e�K � @ sX d Z dZddlmZ ddlmZmZ G dd� de�ZG dd� de�ZG d d
� d
e�Z dS )z
Miscellaneous transforms.
ZreStructuredText� )�nodes)� Transform�TransformErrorc @ s e Zd ZdZdZdd� ZdS )�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 C s$ | j }|jd |� |j�|� d S )N�callback)� startnode�details�parent�remove)�self�pending� r
�I/opt/alt/python37/lib/python3.7/site-packages/docutils/transforms/misc.py�apply s zCallBack.applyN)�__name__�
__module__�__qualname__�__doc__�default_priorityr r
r
r
r r s
r c @ s e Zd ZdZdZdd� ZdS )�ClassAttributez|
Move the "class" attribute specified in the "pending" node into the
immediately following non-comment element.
�� c C s� | j }|j}|}xz|r�xpt|�|�d t|��D ]J}|| }t|tj�s0t|tj�rVq0|d |j d 7 <