v YVSrSSKrSSKrSSKJr 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"S\R(5r\R"S 5r\R"S5rSrSr"SS\R45rg)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]z6&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*)[;=]?z <[a-zA-Z]>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*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_attrvaluerLs   11 55rc^\rSrSrSrSrSS.U4SjjrU4SjrSrS r S r S r S r S r SrSrS SjrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrU=r $)!rPaFind 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. )scriptstyleT)convert_charrefscN>[TU]5 XlUR5 g)zInitialize and reset this instance. If convert_charrefs is True (the default), all character references are automatically converted to the corresponding Unicode characters. N)super__init__rreset)selfr __class__s rr!HTMLParser.__init__hs  0 rcb>SUlSUl[UlSUl[ TU]5 g)z1Reset this instance. Loses all unprocessed data.z???N)rawdatalasttaginteresting_normal interesting cdata_elemr r")r#r$s rr"HTMLParser.resetrs)  -  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.feedzs ||d*  Qrc&URS5 g)zHandle any buffered data.r N)r/r#s rcloseHTMLParser.closes  QrNcUR$)z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_textr5s rget_starttag_textHTMLParser.get_starttag_texts###rcUR5Ul[R"SUR-[R5Ulg)Nz )lowerr,recompileIr+)r#elems rset_cdata_modeHTMLParser.set_cdata_modes/**,::nt&FMrc([UlSUlgr)r*r+r,r5s rclear_cdata_modeHTMLParser.clear_cdata_modes-rc URnSn[U5nX4:GaUR(a|UR(dkUR SU5nUS:aRUR S[ X4S- 55nUS:a,[R"S5RX&5(dGO?UnOHURRX#5nU(aUR5nOUR(aGOUnX5:aRUR(a.UR(dUR[X#U55 OURX#U5 URX55nX4:XaGOURnU"SU5(Ga[ R#X#5(aUR%U5n OU"SU5(aUR'U5n OU"SU5(aUR)U5n ObU"SU5(aUR+U5n OBU"S U5(aUR-U5n O"US -U:aURS5 US -n OGOU S:aU(dGOUR S US -5n U S:a!UR SUS -5n U S:aUS -n OU S - n UR(a.UR(dUR[X#U 55 OURX#U 5 URX95nGOU"S U5(a[.R#X#5nU(a^UR15S Sn UR3U 5 UR55n U"SU S - 5(dU S - n URX95nGMpSX#S;a*URX#US -5 URX3S -5nGO+U"SU5(Ga [6R#X#5nU(a\UR1S 5n UR9U 5 UR55n U"SU S - 5(dU S - n URX95nGM+[:R#X#5nU(aIU(aAUR15X#S:Xa+UR55n X::aUn URX3S -5nO?US -U:a&URS5 URX3S -5nOOS5eX4:aGMU(ahX4:acUR(a.UR(dUR[X#U55 OURX#U5 URX45nX#SUlg)Nr<&"z[\s;]r?searchr+start handle_datar updateposr starttagopenrparse_starttag parse_endtag parse_commentparse_piparse_html_declarationcharrefr handle_charrefend entityrefhandle_entityref incomplete) r#rbr(injampposrr knames rr/HTMLParser.goaheads,,  Le$$T__LLa(q5%]]3At =F! JJx077HHA((//; AAu(($$Xgl%;<$$Wq\2q$Avu ++J#q!!%%g11++A.Aa(())!,A****1-Aa(( a(Aa((33A6A!eq[$$S)AAq5 S!a%0A1u#LLa!e4q5 !AAQ,,T__(('A,)?@((16NN1(D!$$ g1 ;;=2.D''- A%c1Q3//Eq,Agbk)((1Q38 NN1c2C##!3 ;;q>D))$/ A%c1Q3//Eq,A"((4u{{} ;!IIK6 !A NN1!e4!eq[$$S)qa%0A555qSeV 15$$T__  'A,!78  1.q$Ar{ rcpURnX!US-S:XdS5eX!US-S:XaURU5$X!US-S:XaURU5$X!US-R5S:Xa7UR S US-5nUS :Xag UR X!S-U5 US -$UR U5$) NrOrNz+unexpected call to parse_html_declaration()rL z V #%%a( ( qs^{ *,,Q/ / qs^ ! ! #{ 2LLac*E{   WqS/ 07N++A. .rcURnX1US-S;dS5eURSUS-5nUS:XagU(aURX1S-U5 US-$)NrO)rNrKz(unexpected call to parse_bogus_comment()rrPr )r(rShandle_comment)r#rfreportr(poss rrrHTMLParser.parse_bogus_comment'sq,,1~- I1H I-ll3!$ "9    !C 0 1QwrcURnX!US-S:XdS5e[RX!S-5nU(dgUR5nUR X!S-U5 UR 5nU$)NrOrMzunexpected call to parse_pi()rP)r(picloserVrW handle_pirb)r#rfr(rrhs rr^HTMLParser.parse_pi3sn,,1~%F'FF%w!, KKM wsA' IIKrcSUlURU5nUS: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";aUR%U5 U$) Nrr z#unexpected call to parse_starttag()rO'rP")r/>r)r9check_for_whole_start_tagr(tagfind_tolerantrrbr r=r)attrfind_tolerantrappendstriprXr handle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSrB) r#rfendposr(attrsrrjtagmattrnamerest attrvaluerbs rr[HTMLParser.parse_starttag?s#//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 /     ,111##C( rclURn[RX!5nU(aUR5nX$US-nUS:XaUS-$US:Xa@UR SU5(aUS-$UR SU5(agXA:aU$US-$US:XagUS;agXA:aU$US-$[ S 5e) Nr r/rrOrPr'z6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r(locatestarttagend_tolerantrrbr AssertionError)r#rfr(rrhnexts rr$HTMLParser.check_for_whole_start_tagks,, & , ,W 8 AQqS>Ds{1u s{%%dA..q5L%%c1--5Hq5Lrz56u1u 677rc*URnX!US-S:XdS5e[RX!S-5nU(dgUR5n[R X!5nU(dUR bURX!U5 U$[R X!S-5nU(d!X!US-S:XaUS-$URU5$URS5R5nURSUR55nURU5 US-$URS5R5nUR b$XpR :waURX!U5 U$URU5 UR5 U$) NrOrKzunexpected call to parse_endtagr rPrzr)r( endendtagrVrb endtagfindrr,rXrrrr r=rS handle_endtagrE)r#rfr(rrs namematchtagnamerAs rr\HTMLParser.parse_endtagsi,,1~%H'HH%  A#.   ,*  5!12 (..w!U*Q3J33A66ooa(..0G LLimmo6E   w '7N{{1~##% ?? &&  5!12  4   rcHURX5 URU5 gr)rrr#rrs rrHTMLParser.handle_startendtags S( 3rcgrrs rrHTMLParser.handle_starttag rcgrr)r#rs rrHTMLParser.handle_endtagrrcgrrr#rks rraHTMLParser.handle_charrefrrcgrrrs rrdHTMLParser.handle_entityrefrrcgrrr0s rrXHTMLParser.handle_datarrcgrrr0s rrvHTMLParser.handle_commentrrcgrr)r#decls rrqHTMLParser.handle_declrrcgrrr0s rr|HTMLParser.handle_pirrcgrrr0s r unknown_declHTMLParser.unknown_declrr)__starttag_textr,rr+r)r()r )!__name__ __module__ __qualname____firstlineno____doc__rr!r"r2r6r9r:rBrEr/r_rrr^r[rr\rrrrardrXrvrqr|r__static_attributes__ __classcell__)r$s@rrrPs*1+/O$Nu#t/*  (X8D%P           r)rr> _markupbasehtmlr html.entitiesrr__all__r?r*rercr`rrZr{ commentcloserrVERBOSErrrrr ParserBaserrrrrs" 1 .ZZ' ZZ % JJ> ? **@ AzzST zz+& **S/zz)$ ::LMJJ=> ZZ)ZZ JJsO ZZ> ?  6J ''J r