+
    f0i                        R t ^ RIHt ^RIHt ^RIHt ^ RIHu H	t ^ RI
t
^ RIHt R R lt ! R R	]4      t ! R
 R]4      tR tR# )z
Converts `[[WikiLinks]]` to relative links.

See the [documentation](https://Python-Markdown.github.io/extensions/wikilinks)
for details.
)annotations)	Extension)InlineProcessorN)Anyc               (    V ^8  d   QhRRRRRRRR/# )   labelstrbaseendreturn )formats   "c/Users/agent/.openclaw/workspace/venv/lib/python3.14/site-packages/markdown/extensions/wikilinks.py__annotate__r      s(     3 3S 3 3# 3# 3    c                V    \         P                  ! RRV 4      pRP                  WV4      # )z0Build a URL from the label, a base, and an end. z([ ]+_)|(_[ ]+)|([ ]+)_z{}{}{})resubr   )r   r
   r   clean_labels   &&& r   	build_urlr      s&    &&2C?K??4c22r   c                  2   a  ] tR t^%tRtV 3R ltR tRtV ;t# )WikiLinkExtensionz"Add inline processor to Markdown. c           	     	`   < R RR.RRR.RRR.R\         R	./V n         \        SV `  ! R/ VB  R
# )base_url/z%String to append to beginning or URL.end_urlzString to append to end of URL.
html_classwikilinkzCSS hook. Leave blank for none.r   z Callable formats URL from label.Nr   )r   configsuper__init__)selfkwargs	__class__s   &,r   r"   WikiLinkExtension.__init__(   sM    EF>?:'HI)%GH	
 	/"6"r   c                	    Wn         R p\        W P                  4       4      pWn         VP                  P	                  VR^K4       R# )z\[\[([\w0-9_ -]+)\]\]r   N)mdWikiLinksInlineProcessor
getConfigsinlinePatternsregister)r#   r(   WIKILINK_REwikilinkPatterns   &&  r   extendMarkdown WikiLinkExtension.extendMarkdown2   s=     /2;@QR
""?JCr   )r    r(   )	__name__
__module____qualname____firstlineno____doc__r"   r/   __static_attributes____classcell__r%   s   @r   r   r   %   s    -#D Dr   r   c                  J   a  ] tR t^<tRtR V 3R lltR R ltR R ltRtV ;t	# )	r)   zBuild link from `wikilink`. c                    V ^8  d   QhRRRR/# )r   patternr	   r    zdict[str, Any]r   )r   s   "r   r   %WikiLinksInlineProcessor.__annotate__?   s       ^ r   c                	2   < \         SV `  V4       W n        R # )N)r!   r"   r    )r#   r;   r    r%   s   &&&r   r"   !WikiLinksInlineProcessor.__init__?   s    !r   c               $    V ^8  d   QhRRRRRR/# )r   mzre.Match[str]datar	   r   z$tuple[etree.Element | str, int, int]r   )r   s   "r   r   r<   C   s"     ' '] '# ':^ 'r   c                	   VP                  ^4      P                  4       '       d   V P                  4       w  r4pVP                  ^4      P                  4       pV P                  R,          ! WcV4      p\        P
                  ! R4      pWhn        VP                  RV4       V'       d   VP                  RV4       MRpWP                  ^ 4      VP                  ^ 4      3# )   r   ahrefclass )
groupstrip_getMetar    etreeElementtextsetstartr   )	r#   r@   rA   r   r   r   r   urlrD   s	   &&&      r   handleMatch$WikiLinksInlineProcessor.handleMatchC   s    771:,0MMO)HzGGAJ$$&E++k*5GDCc"AFEE&#gz*A''!*aeeAh&&r   c                   V ^8  d   QhRR/# )r   r   ztuple[str, str, str]r   )r   s   "r   r   r<   Q   s     - -. -r   c                .   V P                   R,          pV P                   R,          pV P                   R,          p\        V P                  R4      '       d   RV P                  P                  9   d%   V P                  P                  R,          ^ ,          pRV P                  P                  9   d%   V P                  P                  R,          ^ ,          pRV P                  P                  9   d%   V P                  P                  R,          ^ ,          pWV3# )z#Return meta data or `config` data. r   r   r   Metawiki_base_urlwiki_end_urlwiki_html_class)r    hasattrr(   rU   )r#   r   r   r   s   &   r   rJ   !WikiLinksInlineProcessor._getMetaQ   s    ;;z*++i([[.
477F##$'',,.77<<8;-'',,~6q9 DGGLL0!WW\\*;<Q?
*,,r   )r    )
r1   r2   r3   r4   r5   r"   rQ   rJ   r6   r7   r8   s   @r   r)   r)   <   s    ' '- -r   r)   c                     \        R/ V B # )Nr   )r   )r$   s   ,r   makeExtensionr\   `   s    &v&&r   )r5   
__future__r   rG   r   inlinepatternsr   xml.etree.ElementTreerK   ElementTreer   typingr   r   r   r)   r\   r   r   r   <module>rb      sF    #  , % % 	 3D	 D.!- !-H'r   