Files
intellecton/venv/lib/python3.12/site-packages/pymdownx/__pycache__/critic.cpython-312.pyc
T

138 lines
14 KiB
Plaintext
Raw Normal View History

Ë
cÀj™&ãóÖ—dZddlmZddlmZddlmZddlmZm Z ddl
Z
dZ dZ d Z
e
d
zZd jeee ¬ «Zd
jeeee ¬«ZdZe
j&ee
j(«Ze
j&e«Ze
j&e«Ze
j&d«Ze
j&d«ZGd„d«ZGd„de«ZGd„de«ZGd„de«Zd„Zy)aÈ
Critic.
pymdownx.critic
Parses critic markup and outputs the file in a more visual HTML.
Must be the last extension loaded.
MIT license.
Copyright (c) 2014 - 2017 Isaac Muse <isaacmuse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
é)Ú Extension)Ú Preprocessor)Ú
Postprocessor)ÚSTXÚETXNúúz
czjqqkd:%sz[0-9]+z{stx}(?P<key>{key}){etx})ÚkeyÚstxÚetxzY(?x)
(?:
(?P<block>\<p\>(?P<block_keys>(?:{stx}{key}{etx})+)\</p\>) |
{single}
)
)r
Úsingler r aI(?x)
((?P<critic>(?P<open>\{)
(?:
(?P<ins_open>\+{2})
(?P<ins_text>.*?)
(?P<ins_close>\+{2})
| (?P<del_open>\-{2})
(?P<del_text>.*?)
(?P<del_close>\-{2})
| (?P<mark_open>\={2})
(?P<mark_text>.*?)
(?P<mark_close>\={2})
| (?P<comment>
(?P<com_open>\>{2})
(?P<com_text>.*?)
(?P<com_close>\<{2})
)
| (?P<sub_open>\~{2})
(?P<sub_del_text>.*?)
(?P<sub_mid>\~\>)
(?P<sub_ins_text>.*?)
(?P<sub_close>\~{2})
)
(?P<close>\})))
z-((?:ins|del|mark)\s+)(class=([\'"]))(.*?)(\3)z^(?:\r?\n){2,}$có6—eZdZdZd„Zd„Zd d„Zd„Zd„Zd„Z y)
Ú CriticStashzStash critic marks until ready.có.—||_i|_d|_y)ú Initialize.rN)Ú stash_keyÚstashÚcount)Úselfrs úR/home/antigravity/intellecton/venv/lib/python3.12/site-packages/pymdownx/critic.pyÚ__init__zCriticStash.__init__Ys€ð#ˆŒØˆŒ
؈�
ócó,—t|j«S)zGet length of stash.)Úlenr©rs rÚ__len__zCriticStash.__len__`s€ä�4—:‘:‹ÐrNcó>—|jj||«}|S)z&Get the specified item from the stash.)rÚget)rr
ÚdefaultÚcodes rrzCriticStash.getds€ð�z‰z�~‰~˜c 7Ó+ˆØˆ rcó—|j|=y)z)Remove the specified item from the stash.N)r)rr
s rÚremovezCriticStash.removejs€ð
�J‰J�s‰Orcó®—|jt|j«z}||j|<|xjdz
c_t|zt
zS)z`
Store the code in the stash with the placeholder.
Return placeholder.
é)rÚstrrrÚSOHÚEOT)rr r
s rÚstorezCriticStash.storeosB€ð �n‰nœs 4§:¡:›Ñ.ˆØˆ�
‰
�3‰Ø �
Š
�a‰�
Ü�S‰yœ3‰Ðrcó —i|_d|_y)zClear the stash.rN)rrrs rÚclearzCriticStash.clearzs€ðˆŒ
؈�
r)N)
Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrrr"r(r*©rrrrVs#„Ù)òòóò ò
órrcó:‡—eZdZdZˆfd„Zd„Zd„Zd„Zd„ZˆxZ S)ÚCriticsPostprocessorz8Handle cleanup on post process for viewing critic marks.có0•—t‰|�«||_y©rN©ÚsuperrÚ critic_stash©rr6Ú __class__s €rrzCriticsPostprocessor.__init__„óø€ô ‰ÑÔØ(ˆÕrcóf—d}|jd«}|�|jj|«}|S)zaReplace all critic tags in the paragraph block `<p>(critic del close)(critic ins close)</p>` etc.Nr
)Úgroupr6r)rÚmÚcontentr
s rÚ
subrestorezCriticsPostprocessor.subrestoreŠs4€àˆØ�g‰g�e‹nˆØ ˆ?Ø×'Ñ'×+Ñ+¨CÓ0ˆG؈rcóü—d|jd«jd«vr|jd«S|jd«|jd«z|jd«zdz|jd«zS) zHandle block edits.Úbreakéú rr$éz blocké)r;Úsplit©rr<s rÚ
block_editzCriticsPostprocessor.block_edit’sg€ð �a—g‘g˜a“j×&Ñ& sÓ+Ñ +Ø—7‘7˜1“:Ð à—7‘7˜1“: §¡¨£
Ñ*¨Q¯W©W°Q«ZÑ7¸(ÑBÀQÇWÁWÈQÃZÑOÐ OrcóR—d}|jd«�Rtj|j|jd««}|�Otj|j
|«}n.|j j|jd««}|�|}|�|S|jd«S)z-Replace placeholders with actual critic tags.NÚ
block_keysr
r)r;ÚRE_CRITIC_SUB_PLACEHOLDERÚsubr>ÚRE_CRITIC_BLOCKrGr6r)rr<r=Útexts rÚrestorezCriticsPostprocessor.restorešs™€ðˆØ �7‰7�<Ó Ð ,Ü/×3Ñ3Ø—‘ §¡¨Ó!6óˆGðÐ"Ü)×-Ñ-¨d¯o©o¸wÓG‘à×$Ñ$×(Ñ(¨¯©°«Ó8ˆDØÐØ�Ø!Ð-ˆwÐ=°1·7±7¸1³:Ð=rcóF—tj|j|«}|S)zReplace critic placeholders.)ÚRE_CRITIC_PLACEHOLDERrKrN©rrMs rÚrunzCriticsPostprocessor.runªs€ô%×(Ñ(¨¯©°tÓ<ˆàˆ r)
r+r,r-r.rr>rGrNrRÚ
__classcell__©r8s@rr1r1�s ø„ÙBô)ò òPò>ö rr1cóT‡—eZdZdZˆfd„Zd„Zd„Zd„Zd„Zd„Z d„Z
d d „Z d
„Z ˆxZ
S) ÚCriticViewPreprocessorz0Handle viewing critic marks in Markdown content.có0•—t‰|�«||_yr3r4r7s €rrzCriticViewPreprocessor.__init__µr9rcóÜ—tj|«rd|jjd«zS|jjd«|z|jjd«zS)zHandle critic inserts.z
%s
z&<ins class="critic break">&nbsp;</ins>z<ins class="critic">z</ins>©Ú RE_BLOCK_SEPÚmatchr6r(rQs rÚ_inszCriticViewPreprocessor._ins»sj€ô × Ñ ˜dÔ #Ø $×"3Ñ"3×"9Ñ"9Ð:bÓ"cÑcÐ cà × Ñ × #Ñ #Ð$:Ó ;Ø ñ
à × Ñ × #Ñ # HÓ -ñ
.ð
rcóÖ—tj|«r|jjd«S|jjd«|z|jjd«zS)zHandle critic deletes.z&<del class="critic break">&nbsp;</del>z<del class="critic">z</del>rYrQs rÚ_delzCriticViewPreprocessor._delÆse€ô × Ñ ˜dÔ #Ø×$Ñ$×*Ñ*Ð+SÓTÐ Tà × Ñ × #Ñ #Ð$:Ó ;Ø ñ
à × Ñ × #Ñ # HÓ -ñ
.ð
rcóv—|jjd«|z|jjd«zS)zHandle critic marks.z<mark class="critic">z</mark>)r6r(rQs rÚ_markzCriticViewPreprocessor._markÑs?€ð
× Ñ × #Ñ #Ð$;Ó <Ø ñ
à × Ñ × #Ñ # IÓ .ñ
/ð
rcóf—|jjd|j|d¬«zdz«S)zHandle critic comments.z<span class="critic comment">T)Ústrip_nlz</span>)r6r(Ú html_escaperQs rÚ_commentzCriticViewPreprocessor._commentÚs@€ð
× Ñ × #Ñ #Ø/Ø× Ñ  °Ð Ó5ñ6àñó
ð
rcó0—|jd«r |j|jd««S|jd«r |j|jd««S|jd«rA|j|jd««|j|jd««zS|jd«r |j|jd ««S|jd
«r |j |jd ««Sy )
z:Insert appropriate HTML to tags to visualize Critic marks.Úins_openÚins_textÚdel_openÚdel_textÚsub_openÚ sub_del_textÚ sub_ins_textÚ mark_openÚ mark_textÚcom_openÚcom_textN)r;r\r^r`rdrFs rÚ critic_viewz"CriticViewPreprocessor.critic_viewåsÛ€ð
�7‰7�:Ô Ø—9‘9˜QŸW™W ZÓ0Ó1Ð 1Ø
�W‰W�ZÔ
Ø—9‘9˜QŸW™W ZÓ0Ó1Ð 1Ø
�W‰W�ZÔ
à— ‘ ˜!Ÿ'™' .Ó1Ó2Ø— ‘ ˜!Ÿ'™' .Ó1Ó2ñ3ð
ð�W‰W�[Ô
!Ø—:‘:˜aŸg™g kÓ2Ó3Ð 3Ø
�W‰W�ZÔ
Ø—=‘= §¡¨Ó!4Ó5Ð 5ð!rcó’—|jddk(}|jd«r|r|jd«SdS|jd«r|rdS|jd«S|jd«r|jd «S|jd