eBSrSSKrSSKrSSKJr S/r\R "S5r\R "S5r\R "S5r \R "S5r \R "S 5r \R "S 5r \R "S 5r \R "S 5r\R "S 5r\R "S\R 5r\R "S 5r\R "S5r"SS\R(5rg)zA parser for HTML and XHTML.N)unescape 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 <[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#c^\rSrSrSrSrSS.U4SjjrU4SjrSrS r S r S r S r S r SrSrS SjrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrU=r $)!r>aFind 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__r reset)selfr __class__s 1/opt/imh/python3.13/lib/python3.13/html/parser.pyr HTMLParser.__init__Vs  0 cb>SUlSUl[UlSUl[ TU]5 g)z1Reset this instance. Loses all unprocessed data.z???N)rawdatalasttaginteresting_normal interesting cdata_elemr r)rrs rrHTMLParser.reset`s)  -  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)rgoaheadrdatas rfeedHTMLParser.feedhs ||d*  Qrc&URS5 g)zHandle any buffered data.N)rrs rcloseHTMLParser.closeqs  QrNcUR$)z)Return full source of start tag: '<...>'.)_HTMLParser__starttag_textr$s rget_starttag_textHTMLParser.get_starttag_textws###rcUR5Ul[R"SUR-[R5Ulg)Nz )lowerrrecompileIr)relems rset_cdata_modeHTMLParser.set_cdata_mode{s/**,::nt&FMrc([UlSUlgN)rrrr$s 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(ayX4:atUR(dcUR(a.UR(dUR[X#U55 OURX#U5 URX45nX#SUlg)Nr<&"z[\s;]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$) Nr?r>z+unexpected call to parse_html_declaration()r<zV #%%a( ( qs^u $,,Q/ / qs^ ! ! #{ 2LLac*E{   WqS/ 07N++A. .rcURnX1US-S;dS5eURSUS-5nUS:XagU(aURX1S-U5 US-$)Nr?)r>r;z"unexpected call to parse_comment()rr@r#)rrChandle_comment)rrYreportrposs rrfHTMLParser.parse_bogus_commentsq,,1~- C1B C-ll3!$ "9    !C 0 1QwrcURnX!US-S:XdS5e[RX!S-5nU(dgUR5nUR X!S-U5 UR 5nU$)Nr?r=zunexpected call to parse_pi()r@)rpicloserFrG handle_pirU)rrYrrLr[s rrPHTMLParser.parse_pi!sn,,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()r?rb'r@")r/>ru)r(check_for_whole_start_tagrtagfind_tolerantrLrUrSr,rattrfind_tolerantrappendstriprHendswithhandle_startendtaghandle_starttagCDATA_CONTENT_ELEMENTSr1) rrYendposrattrsrLr]tagmattrnamerest attrvaluerUs rrMHTMLParser.parse_starttag-s#//2 A:M,,&0 &&w!4;;;u IIK"[[^1133 sj!''3A()1a(8 %HI 2A$8)BC.82A#7237%aO $Y/ 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/rur?r@rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)rlocatestarttagend_tolerantrLrUrJAssertionError)rrYrrr[nexts rrv$HTMLParser.check_for_whole_start_tagYs,, & , ,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$) Nr?r;zunexpected call to parse_endtagr#r@rbzr)r endendtagrFrU endtagfindrLrrHrwrfrSr,rC handle_endtagr5)rrYrrLrg namematchtagnamer0s rrNHTMLParser.parse_endtag{si,,1~%H'HH%  A#.   ,*  5!12 (..w!U*Q3J33A66ooa(..0G LLimmo6E   w '7N{{1~##% ?? &&  5!12  4   rcHURX5 URU5 gr4)r}rrrrs rr|HTMLParser.handle_startendtags S( 3rcgr4rs rr}HTMLParser.handle_starttag rcgr4r)rrs rrHTMLParser.handle_endtagrrcgr4rrr^s rrTHTMLParser.handle_charrefrrcgr4rrs rrWHTMLParser.handle_entityrefrrcgr4rrs rrHHTMLParser.handle_datarrcgr4rrs rrjHTMLParser.handle_commentrrcgr4r)rdecls rreHTMLParser.handle_declrrcgr4rrs rrpHTMLParser.handle_pirrcgr4rrs r unknown_declHTMLParser.unknown_declrr)__starttag_textrr rrr)r#)!__name__ __module__ __qualname____firstlineno____doc__r~r rr r%r(r)r1r5rrQrfrPrMrvrNr|r}rrTrWrHrjrerpr__static_attributes__ __classcell__)rs@rrr>s*1+/O$Nu#t/*  (X8D%P           r)rr- _markupbasehtmlr__all__r.rrXrVrRrKro commentcloserwrxVERBOSErrr ParserBaserrrrrs"  .ZZ' ZZ % JJ> ? **@ Azz+& **S/zz)$ ::LMJJ=> ZZ)ZZ JJsO ZZ> ? J ''J r