3 E\ @sjdZdZddlZddlmZmZddlmZddlmZddl m Z Gdd d ej Z Gd d d eZ dS) z4 Directives for typically HTML-specific constructs. ZreStructuredTextN)nodesutils) Directive)states) componentsc@s6eZdZGdddejejejZddZddZ dS)MetaBodyc@seZdZdZdS)z MetaBody.metazHTML-specific "meta" element.N)__name__ __module__ __qualname____doc__r r ~/private/var/folders/pf/wv4htv3x0qs2c2mp0dnn0kchsvlck3/T/pip-install-emcbgzcf/docutils/docutils/parsers/rst/directives/html.pymetasrcCs&|j|\}}|j|7_g|gfS)z Meta element.) parsemetaparent)selfmatchcontext next_statenode blank_finishr r r field_markerszMetaBody.field_markercCsl|j|}|jj|j\}}}}|j}tjtjdd|gd}dj ||d<|s~|jj } |j j d|tj | | } | |fS|j} y&tj| dd\} } | || j<Wn"tjk r| d|d<YnXx| d dD]v}y"tj|d\} } | || j<Wqtjk rR}z.|jj } |j jd ||ftj | | } | |fSd}~XqXqW|jj|||fS) Nwriterhtml) componentformatr contentzNo content for meta tag "%s".rnamez*Error parsing meta tag attribute "%s": %s.)Zparse_field_marker state_machineZget_first_known_indentedendrrpendingrFilterjoinlinereporterinfo literal_blocksplitrZextract_name_valuelowerZNameValueErrorerrordocumentZ note_pending)rrrZindentedindent line_offsetrrr"r%msgtokensZattnamevaltokenZdetailr r r rs@   zMetaBody.parsemetaN) rr r rSpecialZPreBibliographicElementrrrr r r r rsrc@s"eZdZdZdefiZddZdS)MetaTZ state_classescCsv|jtj}|jj|j|j|dd|jd\}}||jt|jkrp|j j j dtj |j |j |jd}||7}|jS)NrT)Z initial_staterZstate_machine_kwargszInvalid meta directive.)r%)Zassert_has_contentrr4stateZnested_list_parserZcontent_offsetSMkwargslenr r&r+r(Z block_textlinenochildren)rrZnew_line_offsetrr+r r r runHs  zMeta.runN)rr r Z has_contentrr7r;r r r r r5Bs r5)r Z __docformat__sysZdocutilsrrZdocutils.parsers.rstrrZdocutils.transformsrZSpecializedBodyrr5r r r r s   0