
    Ci	y                        S SK JrJrJr  S SKrS SKrS SKJr  S SKJ	r	J
r
  S SKJr  S SKJr  \R                  S:  a*  \R                  S:  a  S SKr\R"                  rOS	S
KJr  \rOS SKJr  \R(                  rS\R*                  -   r\R.                  " S5      r\R.                  " S\-   S-   S-   S-   \-   S-   S-   S-   \-   S-   5      r\R.                  " S5      r\R.                  " S\R*                  -   5      r\R.                  " S\R8                  -   \R:                  5      r\R.                  " S5      r\R.                  " S5      r \R.                  " S5      r!\R.                  " S5      r"\R.                  " S5      r#\R.                  " S\R:                  5      r$\R.                  " S5      r%\R.                  " S5      r&\R.                  " S5      r'\R.                  " S 5      r(\R.                  " S!5      r)\R.                  " S"5      r*\R.                  " S#5      r+\R.                  " S$5      r,\R.                  " S%\RZ                  5      r.S& r/S' r0 " S( S)\15      r2g)*    )absolute_importunicode_literalsdivisionN)common)normalize_uriunescape_string)Node)normalize_reference)   r   )r         )	_unescape)entitytransz\\a  [!"#$%&\'()*+,\-./:;<=>?@\[\]\\^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]z^(?:"(z|[^"\x00])*"|z'(z|[^'\x00])*'z\((z|[^()\x00])*\))z^(?:<(?:[^<>\n\\\x00]|\\.)*>)^z`+z^`+z\.\.\.z--+z^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>z/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>z^ *(?:\n *)?z^^[ \t\n\x0b\x0c\x0d]z[ \t\n\x0b\x0c\x0d]+z^\sz *$z^ *z^ *(?:\n|$)z^\[(?:[^\\\[\]]|\\.){0,1000}\]z^[^\n`\[\]\\!<&*_\'"]+c                 *    [        SS 5      nXl        U$ )Ntext)r	   literal)snodes     d/var/www/html/backend/Backoffice_Marketplace/venv/lib/python3.13/site-packages/commonmark/inlines.pyr   r   V   s    DLK    c                    SnSn[        U 5      S-  S:X  a  [        U 5      S-  nOZ[        U 5      S-  S:X  a  [        U 5      S-  nO9[        U 5      S-  S:X  a  Sn[        U 5      S-
  S-  nOSn[        U 5      S-
  S-  nSU-  SU-  -   $ )Nr   r      r   r   u   —u   –)len)charsen_countem_counts      r   smart_dashesr   \   s    HH
5zA~u:?	Ua1	u:?	Ua1	 JNq( JNq(xHx$788r   c                       \ rS rSrSr0 4S jrS rS rS rS r	S r
S	 rS
 rS rS rS r\S 5       rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r \ r!Sr"g) InlineParserq   zINLINE PARSER

These are methods of an InlineParser class, defined below.
An InlineParser keeps track of a subject (a string to be
parsed) and a position in that subject.
c                 H    SU l         S U l        SU l        0 U l        Xl        g )N r   )subjectbracketsposrefmapoptions)selfr)   s     r   __init__InlineParser.__init__y   s#    r   c                     [         R                  " XR                  U R                  S 5      nUc  gU =R                  UR	                  5       -  sl        UR                  5       $ )z
If regexString matches at current position in the subject, advance
position in subject and return the match; otherwise return None.
N)researchr%   r'   endgroup)r*   regexStringmatchs      r   r3   InlineParser.match   sI    
 		+||DHHI'>?=HH		#H;;= r   c                 |    U R                   [        U R                  5      :  a  U R                  U R                      $ g)z_Returns the character at the current subject position, or None if
there are no more characters.N)r'   r   r%   r*   s    r   peekInlineParser.peek   s/     88c$,,''<<))r   c                 .    U R                  [        5        g)zCParse zero or more space characters, including at
most one newline.T)r3   reSpnlr6   s    r   spnlInlineParser.spnl   s     	

6r   c                    U R                  [        5      nUc  gU R                  nU R                  [        5      nUb  XB:X  a  [	        SS5      nU R
                  X0R                  [        U5      -
   R                  SS5      nUR                  S5      (       a!  US   US   s=:X  a  S:X  a  O  OUSS Ul	        OXel	        UR                  U5        g	U R                  [        5      nUb  M  X0l        UR                  [        U5      5        g	)
zxAttempt to parse backticks, adding either a backtick code span or a
literal sequence of backticks to the 'inlines' list.NFcode
 r   r   T)r3   reTicksHerer'   reTicksr	   r%   r   replacelstripr   append_childr   )r*   blockticksafter_open_ticksmatchedr   contentss          r   parseBackticksInlineParser.parseBackticks   s     

;'=88**W%!FD)<<(8#e*9LMWT3' ??3''HQK8B<,N3,N#+Ab>DL#+L""4(jj)G ! $4;'r   c                    U R                   nU =R                  S-  sl         X R                     nU R                  5       S:X  a3  U =R                  S-  sl        [	        SS5      nUR                  U5        gU(       aP  [        R                  " [        U5      (       a0  UR                  [        U5      5        U =R                  S-  sl        gUR                  [        S5      5        g! [         a    Sn Nf = f)z
Parse a backslash-escaped special character, adding either the
escaped character, a hard line break (if the backslash is followed
by a newline), or a literal backslash to the block's children.
Assumes current character is a backslash.
r   Nr?   	linebreak\T)
r%   r'   
IndexErrorr7   r	   rF   r.   r/   reEscapabler   )r*   rG   subjsubjcharr   s        r   parseBackslashInlineParser.parseBackslash   s     ||A	HH~H 99;$HHMHT*Dt$  "))K::tH~.HHMH  tDz*  	H	s   C* *C98C9c                    U R                  [        5      nU(       aW  USS n[        SS5      n[        SU-   5      Ul        SUl        UR                  [        U5      5        UR                  U5        gU R                  [        5      nU(       aT  USS n[        SS5      n[        U5      Ul        SUl        UR                  [        U5      5        UR                  U5        gg)	z?Attempt to parse an autolink (URL or email in pointy brackets).r   rA   linkNzmailto:r$   TF)	r3   reEmailAutolinkr	   r   destinationtitlerF   r   
reAutolink)r*   rG   mdestr   s        r   parseAutolinkInlineParser.parseAutolink   s    JJ'Qr7D%D,Y-=>DDJd4j)t$

:&A2wFD)#0#6 
!!$t*-""4(r   c                     U R                  [        R                  5      nUc  g[        SS5      nX#l        UR                  U5        g)z Attempt to parse a raw HTML tag.NFhtml_inlineT)r3   r   	reHtmlTagr	   r   rF   )r*   rG   r]   r   s       r   parseHtmlTagInlineParser.parseHtmlTag   s@    JJv''(9t,DLt$r   c                    SnU R                   nUS:X  d  US:X  a  US-  nU =R                   S-  sl         ODU R                  5       U:X  a0  US-  nU =R                   S-  sl         U R                  5       U:X  a  M0  US:X  a  gUS:X  a  SOU R                  US-
     nU R                  5       nUc  Sn[        R                  " [
        U5      =(       d    US:H  n[        R                  " [        U5      n[        R                  " [
        U5      =(       d    US:H  n[        R                  " [        U5      n	U(       + =(       a    U(       + =(       d    U=(       d    U	n
U(       + =(       a    U	(       + =(       d    U=(       d    UnUS:X  a3  U
=(       a    U(       + =(       d    U	nU=(       a    U
(       + =(       d    UnO#US:X  d  US:X  a  U
=(       a    U(       + nUnOU
nUnX0l         UUUS	.$ )
z
Scan a sequence of characters == c, and return information about
the number of delimiters and whether they are positioned such that
they can open and/or close emphasis or strong emphasis.  A utility
function for strong/emph parsing.
r   '"r   Nr?       _)	numdelimscan_open	can_close)r'   r7   r%   r.   r/   reUnicodeWhitespaceCharrePunctuation)r*   crk   startposc_beforec_afterafter_is_whitespaceafter_is_punctuationbefore_is_whitespacebefore_is_punctuationleft_flankingright_flankingrl   rm   s                 r   
scanDelimsInlineParser.scanDelims   s    	888qCxNIHHMH99;!#Q	A 99;!# >#q=4dll8a<.H))+?G !ii(?I v 	!yy@!yy#X /   	 !#		- B// $%% #!#" 	 21 #&& " "! 	 8$ >##<'< & <"":&: #Xc$;^);H&I$H&I" "
 	
r   c           
         U R                  U5      nU(       d  gUR                  S5      nU R                  nU =R                  U-  sl        US:X  a  SnO!US:X  a  SnOU R                  XPR                   n[	        U5      nUR                  U5        UUUUU R                  SUR                  S5      UR                  S	5      S
.U l        U R                  S   b  U R                  U R                  S   S'   g)z2Handle a delimiter marker for emphasis or a quote.Frk   rg      ’rh      “Nrl   rm   )ccrk   
origdelimsr   previousnextrl   rm   r   r   T)rz   getr'   r%   r   rF   
delimiters)r*   r   rG   resrk   rq   rK   r   s           r   handleDelimInlineParser.handleDelim7  s    oob!GGK(	88I9H3YH||HXX6HH~4  "#
+-	
 ??:&226//DOOJ'/r   c                     UR                  S5      b  UR                  S5      US   S'   UR                  S5      c  UR                  S5      U l        g UR                  S5      US   S'   g )Nr   r   )r   r   )r*   delims     r   removeDelimiterInlineParser.removeDelimiterX  s_    99Z ,(-		&(9E*f%99V$#ii
3DO(-		*(=E&M*%r   c                 @    U R                  S5      U:w  a	  XS'   XS'   g g )Nr   r   )r   )bottomtops     r   removeDelimitersBetween$InlineParser.removeDelimitersBetweena  s&    ::f$ 6N$
O %r   c                    UUUUS.nSnSnU R                   nUb@  UR                  S5      U:w  a+  UR                  S5      nUb  UR                  S5      U:w  a  M+  UGbL  UR                  S5      (       d  UR                  S5      nGOUR                  S5      nSnUR                  S5      nUb  Xa:w  a  XbU   :w  a  UR                  S5      =(       d    UR                  S5      =(       a#    US	   S
-  S:g  =(       a    US	   US	   -   S
-  S:H  nUR                  S5      U:X  a   UR                  S5      (       a
  U(       d  SnO#UR                  S5      nUb  Xa:w  a
  XbU   :w  a  M  Un	US:X  d  US:X  Ga  U(       d  UR                  S5      nGOUS   S:  a  US   S:  a  SOSnUR                  S5      n
UR                  S5      nUS==   U-  ss'   US==   U-  ss'   U
R                  S [        U
R                  5      U-
   U
l        UR                  S [        UR                  5      U-
   Ul        US:X  a  [	        SS 5      nO[	        SS 5      nU
R
                  nU(       aB  X:w  a=  UR
                  nUR                  5         UR                  U5        UnU(       a  X:w  a  M=  U
R                  U5        U R                  Xe5        US   S:X  a!  U
R                  5         U R                  U5        US   S:X  a(  UR                  5         US   nU R                  U5        UnOMUS:X  a!  SUS   l        U(       a
  SUS   l        US   nO&US:X  a   SUS   l        U(       a
  SUS   l        US   nU(       d)  U(       d"  U	S   X('   U	S   (       d  U R                  U	5        Ub  GML  U R                   bM  U R                   U:w  a<  U R                  U R                   5        U R                   b  U R                   U:w  a  M:  g g g g )N)rj   *rg   rh   Fr   r   rm   r   r   rl   r   r   Tr   rj   rk   r   r   r   emphstrongrg   r}   u   ‘rh   u   ”r~   )r   r   r   r   r	   nxtunlinkrF   insert_afterr   r   )r*   stack_bottomopeners_bottom	odd_match
use_delimscloseropeneropener_foundclosercc
old_closer
opener_inl
closer_inlr   tmpr   	tempstacks                   r   processEmphasisInlineParser.processEmphasisg  s   	
 	
  VZZ
%;|%KZZ
+F  VZZ
%;|%K  ::k**F+  J/$!::d+)f.D!99!'J!7 "9!'K!8!A!'!5!9Q!>!A #)"6"("6#7:;"<?@"A 
 zz$'83zz*--$'+#ZZ
3F )f.D!99 $
s?h#o'!'F!3
 #;/14";/14 &';< # &,ZZ%7
%+ZZ%7
 {+z9+{+z9+-7-?-?AS!3!34zA.C
*-7-?-?AS!3!34zA.C
* &?#'#5D#'$#7D(nn!c&7"%''CJJL --c2"%C	 "c&7 #//5 44VD "+.!3&--/ 008!+.!3&--/(.vI 008%.F_-5F6N*#19v.#F^F_-5F6N*#19v.#F^F#I 0:*/EN,%j1 ,,Z8C  H oo)doo.M  1 oo)doo.M).M)r   c                 P    U R                  [        5      nUc  g[        USS 5      $ )zV
Attempt to parse link title (sans quotes), returning the string
or None if no match.
Nr   rA   )r3   reLinkTitler   )r*   r[   s     r   parseLinkTitleInlineParser.parseLinkTitle  s-    
 

;'= #52;//r   c                 p   U R                  [        5      nUGc  U R                  5       S:X  a  gU R                  nSn U R                  5       nUc  GOUS:X  a  [        R
                  " [        U R                  U R                  S-   U R                  S-    5      (       a<  U =R                  S-  sl        U R                  5       b  U =R                  S-  sl        OUS:X  a  U =R                  S-  sl        US-  nO^US:X  a"  US:  a  OTU =R                  S-  sl        US-  nO6[        R
                  " [        U5      (       a  OU =R                  S-  sl        GM   U R                  U:X  a  US:w  a  gU R                  X R                   n[        [        U5      5      $ [        [        USS	 5      5      $ )
zN
Attempt to parse link destination, returning the string or
None if no match.
N<r   rP   r   r   ()rA   )r3   reLinkDestinationBracesr7   r'   r.   r/   rR   r%   reWhitespaceCharr   r   )r*   r   savepos
openparensrp   s        r   parseLinkDestination!InlineParser.parseLinkDestination  si   
 jj01;yy{c!hhGJIIK99#T\\$((1*TXXaZ%H"J "JHHMHyy{.A#XHHMH!OJ#X!A~A"a
YY/33HHMH+ , xx7"qCx,,wxx0C !566 !Qr!;<<r   c                 h    U R                  [        5      nUb  [        U5      S:  a  g[        U5      $ )zG
Attempt to parse a link label, returning number of
characters parsed.
i  r   )r3   reLinkLabelr   )r*   r]   s     r   parseLinkLabelInlineParser.parseLinkLabel  s-     JJ{#9Aq6Mr   c                     U R                   nU =R                   S-  sl         [        S5      nUR                  U5        U R                  X2S5        g)zN
Add open bracket to delimiter stack and add a text node to
block's children.
r   [FT)r'   r   rF   
addBracketr*   rG   rq   r   s       r   parseOpenBracketInlineParser.parseOpenBracket!  sD    
 88ACy4  	.r   c                 0   U R                   nU =R                   S-  sl         U R                  5       S:X  aG  U =R                   S-  sl         [        S5      nUR                  U5        U R	                  X2S-   S5        gUR                  [        S5      5        g)z
If next character is [, and ! delimiter to delimiter stack and
add a text node to block's children. Otherwise just add a text
node.
r   r   z![T!)r'   r7   r   rF   r   r   s       r   	parseBangInlineParser.parseBang0  s|     88A99;#HHMH:Dt$ OODQ,5  tCy)r   c                    SnSnU =R                   S-  sl         U R                   nU R                  nUc  UR                  [        S5      5        gUR	                  S5      (       d+  UR                  [        S5      5        U R                  5         gUR	                  S5      nU R                   nU R                  5       S:X  a  U =R                   S-  sl         U R                  5         U R                  5       nUb  U R                  5       (       a  [        R                  " [        U R                  U R                   S-
     5      (       a  U R                  5       nU R                  5       (       a+  U R                  5       S	:X  a  U =R                   S-  sl         SnOXpl         U(       d  U R                   n	U R                  5       n
U
S
:  a  U R                  XU
-    nO4UR	                  S5      (       d  U R                  UR	                  S5      U nU
S:X  a  Xpl         W(       a7  U R                  R	                  [!        U5      5      nU(       a  US   nUS   nSnU(       Ga.  [#        U(       a  SOSS5      nWUl        U=(       d    SUl        UR	                  S5      R(                  nU(       a8  UR(                  nUR+                  5         UR                  U5        UnU(       a  M8  UR                  U5        U R-                  UR	                  S5      5        U R                  5         UR	                  S5      R+                  5         U(       d@  U R                  nUb1  UR	                  S5      (       d  SUS'   UR	                  S5      nUb  M1  gU R                  5         X@l         UR                  [        S5      5        g)z
Try to match close bracket against an opening in the delimiter
stack. Add either a link or image, or a plain [ character,
to block's children. If there is a matching delimiter,
remove it from the delimiter stack.
NFr   ]Tactiveimager   r   r   bracket_afterindexr   rZ   r[   rX   r$   r   previousDelimiterr   )r'   r&   rF   r   r   removeBracketr7   r;   r   r.   r/   r   r%   r   r   r(   r
   r	   rZ   r[   r   r   r   )r*   rG   r[   rJ   rq   r   is_imager   r^   beforelabelnreflabelrX   r   r   r   s                   r   parseCloseBracketInlineParser.parseCloseBracketE  s    A88 >tCy)zz(##tCy)  ::g& (( 99;#HHMHIIK,,.DDIIKK99-t||DHHQJ/GHH //1E99;;499;##5HHMH"G"((K##%A1u<<!ODZZ00
  <<

7(;HEAv"{{':8'DE.D ME"G8>D#D"DJ**V$((Cgg

!!#&	 #
 t$  ,?!@A JJv%%' (!::g..+0x(#ZZ
3F	 (   HtCy)r   c                     U R                   b  SU R                   S'   UU R                   U R                  UUSS.U l         g )NTbracketAfter)r   r   r   r   r   r   )r&   r   )r*   r   r   r   s       r   r   InlineParser.addBracket  s?    ==$,0DMM.) !%
r   c                 D    U R                   R                  S5      U l         g )Nr   )r&   r   r6   s    r   r   InlineParser.removeBracket  s    ))*5r   c                     U R                  [        5      nU(       a$  UR                  [        [	        U5      5      5        gg)zAttempt to parse an entity.TF)r3   reEntityHererF   r   HTMLunescape)r*   rG   r]   s      r   parseEntityInlineParser.parseEntity  s0    JJ|$tLO45r   c                 Z   U R                  [        5      nU(       a  U R                  R                  S5      (       aT  [        R
                  " [        SU5      n[        R
                  " [        S U5      nUR                  [        U5      5        gUR                  [        U5      5        gg)zr
Parse a run of ordinary characters, or a single character with
a special meaning in markdown, as a plain string.
smartu   …c                 4    [        U R                  5       5      $ )N)r   r1   )xs    r   <lambda>*InlineParser.parseString.<locals>.<lambda>  s    \!'')-Dr   TF)
r3   reMainr)   r   r.   sub
reEllipsesreDashrF   r   )r*   rG   r]   r   s       r   parseStringInlineParser.parseString  s    
 JJv||((FF:x3FF6#DaH""47+  ""47+r   c                    U =R                   S-  sl         UR                  nU(       a  UR                  S:X  a  UR                  S   S:X  a  [	        UR                  5      S:  =(       a    UR                  S   S:H  n[
        R                  " [        SUR                  5      Ul        U(       a  [        SS	5      nO[        S
S	5      nUR                  U5        OUR                  [        S
S	5      5        U R                  [        5        g)zl
Parse a newline.  If it was preceded by two spaces, return a hard
line break; otherwise a soft line break.
r   r   rA   r@   r   r$   rO   N	softbreakT)r'   
last_childtr   r   r.   r   reFinalSpacer	   rF   r3   reInitialSpace)r*   rG   lastcrO   r   s        r   parseNewlineInlineParser.parseNewline  s     	A  UWW&5==+<+CEMM*a/LEMM"4E4LIFF<U]]CEMK.K.t$tK67 	

>"r   c                    Xl         SU l        U R                  nU R                  5       nUS:X  d  US:X  a  gU R                   SU nU R                  5       S:X  a  U =R                  S-  sl        OX0l        gU R	                  5         U R                  5       nUc  X0l        gU R                  nU R	                  5         SnU R                  U:w  a  U R                  5       nUc  SnXpl        Sn	U R                  [        5      c+  US:X  a  Sn	O"US:H    Xpl        U R                  [        5      SLn	U	(       d  X0l        g[        U5      n
U
S:X  a  X0l        gUR                  U
5      (       d  UUS	.X*'   U R                  U-
  $ )
z4Attempt to parse a link reference, modifying refmap.r   r   N:r   r$   TF)rZ   r[   )r%   r'   r   r7   r;   r   r   r3   reSpaceAtEndOfLiner
   r   )r*   r   r(   rq   match_charsrawlabelr^   beforetitler[   at_line_end	normlabels              r   parseReferenceInlineParser.parseReference  sm   88 ))+!{a/||L[1H IIK3HHMHH 			((*<Hhh		88{"'')E=E"H ::()1{#
 &"jj);<DHH'1	?Hzz)$$#!F 8#$r   c                 .   SnU R                  5       nUc  gUS:X  a  U R                  U5      nGO0US:X  a  U R                  U5      nGOUS:X  a  U R                  U5      nOUS:X  d  US:X  a  U R	                  X15      nOUS:X  d  US:X  a4  U R
                  R                  S	5      =(       a    U R	                  X15      nOUS
:X  a  U R                  U5      nOUS:X  a  U R                  U5      nOqUS:X  a  U R                  U5      nOYUS:X  a*  U R                  U5      =(       d    U R                  U5      nO)US:X  a  U R                  U5      nOU R                  U5      nU(       d/  U =R                  S-  sl        UR                  [!        U5      5        g)z
Parse the next inline element in subject, advancing subject
position.

On success, add the result to block's children and return True.
On failure, return False.
Fr?   rP   `r   rj   rg   rh   r   r   r   r   r   &r   T)r7   r   rU   rL   r   r)   r   r   r   r   r_   rd   r   r   r'   rF   r   )r*   rG   r   rp   s       r   parseInlineInlineParser.parseInline:  se    IIK99##E*C$Y%%e,C#X%%e,C#Xc""1,C#Xc,,""7+J0@0@0JC#X''.C#X..'C#X((/C#X$$U+Gt/@/@/GC#X""5)C""5)CHHMHtAw'r   c                     UR                   R                  5       U l        SU l        SU l        SU l        U R                  U5      (       a   U R                  U5      (       a  M  SUl         U R                  S5        g)zY
Parse string content in block into inline children,
using refmap to resolve references.
r   N)string_contentstripr%   r'   r   r&   r   r   )r*   rG   s     r   parseInlinesInlineParser.parseInlinesc  sn    
 ++113&& &&  $T"r   )r&   r   r)   r'   r(   r%   N)#__name__
__module____qualname____firstlineno____doc__r+   r3   r7   r;   rL   rU   r_   rd   rz   r   r   staticmethodr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  parse__static_attributes__ r   r   r!   r!   q   s      " 
!266	=
~B> % %
u2n
0(=T*l\
6".D%L'R# Er   r!   )3
__future__r   r   r   r.   sys
commonmarkr   commonmark.commonr   r   commonmark.noder	   commonmark.normalize_referencer
   version_infohtmlunescaper   r   r   	ESCAPABLEESCAPED_CHARcompilero   r   r   rR   ENTITY
IGNORECASEr   rC   rB   r   r   rY   r\   r:   r   reWhitespacern   r   r   r   r   	MULTILINEr   r   r   objectr!   r  r   r   <module>r     s8   B B 	 
  <   >v
6!}}* &((L (((

E8 jj|o-	
,-  	 	 0	01 **%EF jjv///0zz#-r}}=
**U
jj ZZ	"
	F	**>? ZZ6MM
 
O	$::67 zz12**V, zz&!F#ZZ/ jj:;	-r||	<9*A6 Ar   