D,biTSrSSKrSSKrSSKJr SSKJr S/r\R"S5r \R"S5r \R"S5r \R"S 5r \R"S 5r\R"S 5r\R"S 5r\R"S 5r\R"S5r\R"S5r\R"S5r\R"S5r\R"S\R,5r\R"S\R,5r\R"S\R,5r\R"S5r\R"S5rSrSr"SS\R<5rg)zA parser for HTML and XHTML.N)unescape)html5 HTMLParserz[&<]z &[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z&#(?:[0-9]|[xX][0-9a-fA-F])z6&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*)[;=]?z <[a-zA-Z]z z--!?>z-?>z0([a-zA-Z][^\t\n\r\f />]*)(?:[\t\n\r\f ]|/(?!>))*a{ ( (?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]* # attribute name ) ([\t\n\r\f ]*=[\t\n\r\f ]* # value indicator ('[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value |(?!['"])[^>\t\n\r\f ]* # bare value ) )? (?:[\t\n\r\f ]|/(?!>))* # possibly followed by a space a [a-zA-Z][^\t\n\r\f />]* # tag name [\t\n\r\f /]* # optional whitespace before attribute name (?:(?<=['"\t\n\r\f /])[^\t\n\r\f />][^\t\n\r\f /=>]* # attribute name (?:[\t\n\r\f ]*=[\t\n\r\f ]* # value indicator (?:'[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value |(?!['"])[^>\t\n\r\f ]* # bare value ) )? [\t\n\r\f /]* # possibly followed by a space )* >? aF <[a-zA-Z][^\t\n\r\f />\x00]* # tag name (?:[\s/]* # optional whitespace before attribute name (?:(?<=['"\s/])[^\s/>][^\s/=>]* # attribute name (?:\s*=+\s* # value indicator (?:'[^']*' # LITA-enclosed value |"[^"]*" # LIT-enclosed value |(?!['"])[^>\s]* # bare value ) \s* # possibly followed by a space )?(?:\s|/(?!>))* )* )? \s* # trailing whitespace z#cURS5nURS5(a [U5$URS5(dUSS[;a [U5$U$)Nr&#=)group startswithrendswithhtml5_entities)matchrefs 2/opt/alt/python313/lib64/python3.13/html/parser.py_replace_attr_charrefr]sU ++a.C ~~d} <<  QRN!:} Jc6[R[U5$N) attr_charrefsubr)ss r_unescape_attrvalueris   11 55rc^\rSrSrSrSrSrSSS.U4SjjrU4S jrS r S r S r S r SS.Sjr SrS%SjrSrSrS%SjrS&SjrSrSrSrSrSrSrSrSrSrSrS rS!rS"r S#r!S$r"U=r#$)'rmaFind tags and other markup and call handler functions. Usage: p = HTMLParser() p.feed(data) ... p.close() Start tags are handled by calling self.handle_starttag() or self.handle_startendtag(); end tags by self.handle_endtag(). The data between tags is passed from the parser to the derived class by calling self.handle_data() with the data as argument (the data may be split up in arbitrary chunks). If convert_charrefs is True the character references are converted automatically to the corresponding Unicode character (and self.handle_data() is no longer split in chunks), otherwise they are passed by calling self.handle_entityref() or self.handle_charref() with the string containing respectively the named or numeric reference as the argument. )scriptstylexmpiframenoembednoframes)textareatitleTF)convert_charrefs scriptingcZ>[TU]5 XlX lUR 5 g)aJInitialize and reset this instance. If convert_charrefs is true (the default), all character references are automatically converted to the corresponding Unicode characters. If *scripting* is false (the default), the content of the ``noscript`` element is parsed normally; if it's true, it's returned as is without being parsed. N)super__init__r$r%reset)selfr$r% __class__s rr(HTMLParser.__init__s$  0" rc~>SUlSUl[UlSUlSUlSUl[TU]!5 g)z1Reset this instance. Loses all unprocessed data.z???NT) rawdatalasttaginteresting_normal interesting cdata_elem_support_cdata _escapabler'r))r*r+s rr)HTMLParser.resets8  -"  rcNURU-UlURS5 g)zyFeed data to the parser. Call this as often as you want, with as little or as much text as you want (may include '\n'). rN)r/goaheadr*datas rfeedHTMLParser.feeds ||d*  Qrc&URS5 g)zHandle any buffered data.r N)r8r*s rcloseHTMLParser.closes  QrNcUR$)z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_textr>s rget_starttag_textHTMLParser.get_starttag_texts###r escapablecUR5UlX lURS:Xa[R"S5UlgU(aZUR (dI[R"SUR-[R[R-5Ulg[R"SUR-[R[R-5Ulg)N plaintextz\Zz&|])z])) lowerr3r5recompiler2r$ IGNORECASEASCII)r*elemrFs rset_cdata_modeHTMLParser.set_cdata_modes**,# ??k )!zz%0D  t44!zz*Dt*V*,--*@ BD  "zz*BT__*T*,--*@ BD rc6[UlSUlSUlg)NT)r1r2r3r5r>s rclear_cdata_modeHTMLParser.clear_cdata_modes-rcXlg)aEnable or disable support of the CDATA sections. If enabled, "<[CDATA[" starts a CDATA section which ends with "]]>". If disabled, "<[CDATA[" starts a bogus comments which ends with ">". This method is not called by default. Its purpose is to be called in custom handle_starttag() and handle_endtag() methods, with value that depends on the adjusted current node. See https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state for details. N)r4)r*flags r_set_support_cdataHTMLParser._set_support_cdatas #rc2 URnSn[U5nX4:GaUR(a|UR(dkUR SU5nUS:aRUR S[ X4S- 55nUS:a,[R"S5RX&5(dGOvUnOHURRX#5nU(aUR5nOUR(aGO-UnX5:aRUR(a.UR(aUR[X#U55 OURX#U5 URX55nX4:XaGOUR nU"SU5(Ga["R%X#5(aUR'U5n OU"SU5(aUR)U5n OU"SU5(aUR+U5n OiU"SU5(aUR-U5n OIU"S U5(aUR/U5n O)US -U:dU(aURS5 US -n OGOU S:GaU(dGO["R%X#5(aGOrU"SU5(aPUS -U:XaURS5 GOH[0R%X#5(aGO,UR3X#S -S5 GOU"SU5(aKUnS H,n UR5XS -5(dMU[U 5-n O UR3X#S -U5 OU"SU5(a(UR6(aUR9X#S-S5 OX#US-R;5S:XaUR=X#S -S5 OUU"S U5(aUR3X#S -S5 O0U"SU5(aUR?X#S -S5 O [AS5eUn URX95nGOU"SU5(a[BR%X#5nU(a^URE5S Sn URGU 5 URI5n U"SU S - 5(dU S - n URX95nGMu[JR%X#5nU(a2U(a)URGX#S -S5 URX45nGOEGOCUS-U:a'URS5 URX3S -5nGO GOU"SU5(a[LR%X#5nU(a\URES 5n UROU 5 URI5n U"SU S - 5(dU S - n URX95nGM{[PR%X#5nU(a0U(a(UROX#S -S5 URX45nO@O?US -U:a&URS5 URX3S -5nOOS5eX4:aGMU(ahX4:acUR(a.UR(aUR[X#U55 OURX#U5 URX45nX#SUlg)Nr<&"z [\t\n\r\f ;]>wOOA((//; AAu((T__$$Xgl%;<$$Wq\2q$Avu ++J#q!!%%g11++A.Aa(())!,A****1-Aa(( a(Aa((33A6A!eq[C$$S)AAq5#))'55#D!,,q5A: ,,T2'--g99 !//! >#FA..&8F&//!<< !S[ 0 %'9++GaCN;#K338K8K))'A#$-8 1Q3--/;>((17#D!,,++GaCDM:#D!,,wst}5,-FGGANN1(D!$$ g1 ;;=2.D''- A%c1Q3//Eq,A*00<++GaCDM: NN10UQY$$T*qa%0AC##!3 ;;q>D))$/ A%c1Q3//Eq,A"((4--gcdm< NN10UQY$$S)qa%0A555qGeJ 15$$  'A,!78  1.q$Ar{ rcURnX!US-S:XdS5eX!US-S:XaURU5$X!US-S:XaHUR(a7URSUS-5nUS :ag UR X!S -U5 US -$X!US-R 5S :Xa7URS US-5nUS :Xag UR X!S-U5 US-$URU5$)Nr`r_z+unexpected call to parse_html_declaration()rbr]rercz]]>rrgrdrfrr )r/rtr4rjryrIrzparse_bogus_comment)r*rr/rgtposs rrv!HTMLParser.parse_html_declarationjs,,1~% D)C D% QqS>V #%%a( ( qs^{ *t/B/B UAaC(A1u   gc1o .q5L qs^ ! ! #{ 2LLac*E{   WqS/ 07N++A. .rcNURnURSU5(dS5e[RX1S-5nU(d [R X1S-5nU(dgU(a&UR 5nURX1S-U5 UR5$)Nr]z"unexpected call to parse_comment()rbrg) r/r commentclosermcommentabruptcloserrnrxr)r*rreportr/rrs rrtHTMLParser.parse_comments,,!!&!,,R.RR,##GqS1&,,Wc:E  A   !Q 0yy{rcURnX1US-S;dS5eURSUS-5nUS:XagU(aURX1S-U5 US-$)Nr`)r_r\z(unexpected call to parse_bogus_comment()rrgr )r/rjrx)r*rrr/poss rrHTMLParser.parse_bogus_commentsq,,1~- I1H I-ll3!$ "9    !C 0 1QwrcURnX!US-S:XdS5e[RX!S-5nU(dgUR5nUR X!S-U5 UR 5nU$)Nr`r^zunexpected call to parse_pi()rg)r/piclosermrnr{rr*rr/rrs rruHTMLParser.parse_pisn,,1~%F'FF%w!, KKM wsA' IIKrc,SUlURU5nUS:aU$URnX1UUl/n[R X1S-5nU(dS5eUR 5nUR S5R5=UlnXb:a[R X65nU(dOUR SSS5upn U (dSn O0U SSSs=:Xa U SS:XdO U SSSs=:Xa U SS:XaO OU SSn U (a [U 5n URU R5U 45 UR 5nXb:aMX6UR5n U S ;aURX1U5 U$U RS 5(aURXt5 U$UR!Xt5 XpR";dUR$(aUS :XdUS :XaUR'US S9 U$XpR(;aUR'USS9 U$)Nrr z#unexpected call to parse_starttag()r`rd'rg")r/>rnoscriptrHFrET)rBcheck_for_whole_start_tagr/tagfind_tolerantrrr rIr0attrfind_tolerantrappendstripror handle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSr%rORCDATA_CONTENT_ELEMENTS) r*rendposr/attrsrrtagmattrnamerest attrvaluers rrrHTMLParser.parse_starttags $//2 A:M,,&0 &&w!4;;;u IIK"[[^1133 sj!''3A()1a(8 %HI 2A$8)BC.82A#7237%aO / : LL(..*I6 7Aj%%' k !   Wv. /M <<    # #C /    ,222C:$5{"##C5#9 444##C4#8 rcURn[RX!S-5nU(deUR5nX$S- S:wagU$)Nr rrg)r/ locatetagendrrrs rr$HTMLParser.check_for_whole_start_tagsG,,""7aC0 u IIK Q3<3 rc.URnX!US-S:XdS5eURSUS-5S:ag[RX!5(d$X!S-US-S:XaUS-$UR U5$[ RX!S-5nU(deUR 5nX$S- S:wag[RX!S-5nU(deURS5R5nURU5 UR5 U$) Nr`r\zunexpected call to parse_endtagrrrgrdr ) r/rjrwrrrrrr rI handle_endtagrR)r*rr/rrrs rrsHTMLParser.parse_endtags ,,1~%H'HH% <<QqS !A %++s1Q33&s //22""7aC0 u IIK Q3<3 !&&w!4 ukk!n""$ 3 rcHURX5 URU5 gr)rrr*rrs rrHTMLParser.handle_startendtags S( 3rcgrrs rrHTMLParser.handle_starttag  rcgrr)r*rs rrHTMLParser.handle_endtag rrcgrrr*rs rr~HTMLParser.handle_charrefrrcgrrrs rrHTMLParser.handle_entityrefrrcgrrr9s rroHTMLParser.handle_datarrcgrrr9s rrxHTMLParser.handle_commentrrcgrr)r*decls rrzHTMLParser.handle_decl!rrcgrrr9s rr{HTMLParser.handle_pi%rrcgrrr9s rryHTMLParser.unknown_decl(rr) __starttag_textr5r4r3r$r2r0r/r%)T)r )$__name__ __module__ __qualname____firstlineno____doc__rrr(r)r;r?rBrCrOrRrVr8rvrtrrurrrrsrrrr~rrorxrzr{ry__static_attributes__ __classcell__)r+s@rrrms0Y3+/5  O$16 B # O#h/2   .d<           r) rrJ _markupbasehtmlr html.entitiesrr__all__rKr1rrr}rrrqrwrrrrVERBOSErrlocatestarttagend_tolerant endendtag endtagfindrr ParserBaserrrrrsi" 1 .ZZ' ZZ % JJ> ? **@ AZZ =>zzST zz+& ZZ % **S/zz(# ZZ'::QRJJ ZZ zz ZZ   ZZ)ZZ JJsO ZZ> ?  6| ''| r