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

66 lines
6.6 KiB
Plaintext
Raw Normal View History

Ë
j>ãóüdZddlmZddlmZddlmZddlZddlZddl Z e jd«Z dd d
d d œZ e jd
«Z
e jd«ZdZdZGdde«ZGdde«ZdZy)
B64.
An extension for Python Markdown.
Given an absolute base path, this extension searches for image tags,
and if the images are local, will embed the images in base64.
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)Ú
Postprocessoré)ÚutilNz^/[A-Za-z]{1}:/.*z image/pngz
image/jpegz image/gifz
image/svg+xml))z.png)z.jpgz.jpeg)z.gif)z.svgaV(?xus)
(?:
(?P<avoid>
<\s*(?P<script_name>script|style)[^>]*>.*?</\s*(?P=script_name)\s*> |
(?:(\r?\n?\s*)<!--[\s\S]*?-->(\s*)(?=\r?\n)|<!--[\s\S]*?-->)
)|
(?P<open><\s*(?P<tag>img))
(?P<attr>(?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'))?)*)
(?P<close>\s*(?:\/?)>)
)
z(?xus)
(?P<attr>
(?:
(?P<name>\s+src\s*=\s*)
(?P<path>"[^"]*"|'[^']*')
)
)
c ó,|jd«} tj|jd«dd«\}}}}}}}}|stj|«}|r tj
j
|«}n=tj
j
tj
j||««}tj
j|«r tj
j|«dj«}tD]g} || vsŒt|d«5}
djt| tj|
j!««j#d««}ddd«|S|S#1swYŒxYw#t$$rY|SwxYw) z#Replace path with b64 encoded data.rÚpathréÿÿÿÿÚrbz src="data:{};base64,{}"ÚasciiN)ÚgrouprÚ parse_urlÚurl2pathÚosrÚnormpathÚjoinÚexistsÚsplitextÚlowerÚ
file_typesÚopenÚformatÚbase64Ú b64encodeÚreadÚdecodeÚ Exception) ÚmÚ base_pathÚlinkÚ_rÚis_urlÚ is_absoluteÚ file_nameÚextÚb64_extÚfs úO/home/antigravity/intellecton/venv/lib/python3.12/site-packages/pymdownx/b64.pyÚ repl_pathr(Ds\ð
7‰71:€Dð
Ü37·>±>À!Ç'Á'È&Ã/ÐRSÐTVÐBWÓ3XÑ0ˆˆ1ˆdAq˜!˜V Ü—== Ó&ˆDá ÜŸ×Ó.‰IäŸ×¯©¯©°iÀÓ)FÓGˆIä
7‰7>‰>˜ —''×" -¨aÑ0×8ˆ
ؘ'˜Ó°!Ø;×& "×,¨Q¯V©V«XÓ=¸gÓ ˜÷ð
ð
€Kð
ð €K÷ðûô ò