+
    '(j
                        ^ RI Ht ^ RIHt ^ RIHt ^ RIt^ RIHtH	t	H
t
Ht ^ RIt^RIHt RtR R ltR	 R
 lt]P$                  ! R4      t]P$                  ! R4      tRR R lltR# )    )annotations)Callable)suppressN)quoteunquoteurlparse
urlunparse)	_punycodec                    V ^8  d   QhRRRR/#    urlstrreturn )formats   "U/home/ubuntu/cf-venv/lib/python3.14/site-packages/markdown_it/common/normalize_url.py__annotate__r      s     . .s .s .    c                   \         P                  ! V RR7      pVP                  '       dx   VP                  '       d   VP                  \        9   dQ   \        \        4      ;_uu_ 4        VP                  \        P                  ! VP                  4      R7      pRRR4       \         P                  ! \         P                  ! V4      4      #   + '       g   i     L:; i)zfNormalize destination URLs in links

::

    [label]:   destination   'title'
            ^^^^^^^^^^^
Tslashes_denote_hosthostnameN)mdurlparser   protocolRECODE_HOSTNAME_FORr   	Exception_replacer
   to_asciiencoder   r   parseds   & r   normalizeLinkr%      s     [[$7F OOOv2EEi  __i.@.@.Q_RF ! <<V,-- ! s   )1CC	c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   (   s     P P3 P3 Pr   c                   \         P                  ! V RR7      pVP                  '       dx   VP                  '       d   VP                  \        9   dQ   \        \        4      ;_uu_ 4        VP                  \        P                  ! VP                  4      R7      pRRR4       \         P                  ! \         P                  ! V4      \         P                  R,           4      #   + '       g   i     LP; i)zCNormalize autolink content

::

    <destination>
     ~~~~~~~~~~~
Tr   r   N%)r   r   r   r   r   r   r   r    r
   
to_unicodedecoder   DECODE_DEFAULT_CHARSr#   s   & r   normalizeLinkTextr,   (   s     [[$7F OOOv2EEi  __i.B.B6??.S_TF ! <<V,e.H.H3.NOO	 ! s   )1C""C2	z!^(vbscript|javascript|file|data):z!^data:image\/(gif|png|jpeg|webp);c               $    V ^8  d   QhRRRRRR/# )r   r   r   	validatorzCallable[[str], bool] | Noner   boolr   )r   s   "r   r   r   F   s'     P Pc P&B Pd Pr   c                    Ve	   V! V 4      # V P                  4       P                  4       p \        P                  V 4      '       d   \	        \
        P                  V 4      4      # R# )zValidate URL link is allowed in output.

This validator can prohibit more than really needed to prevent XSS.
It's a tradeoff to keep code simple and to be secure by default.

Note: url should be normalized at this point, and existing entities decoded.
T)striplowerBAD_PROTO_REsearchr/   GOOD_DATA_RE)r   r.   s   &&r   validateLinkr6   F   sS     ~
))+


C-9-@-@-E-E4##C()O4Or   )zhttp:zhttps:zmailto:)N)
__future__r   collections.abcr   
contextlibr   reurllib.parser   r   r   r	   r    r
   r   r%   r,   compiler3   r5   r6   r   r   r   <module>r>      sZ    " $  	 = =  4 .2P4 zz>?zz>?P Pr   