Re: [PATCH] removing nodes from a dom
Tidy Project <[email protected]> Mon, 13 Jul 2015 15:48:18 +0200
| Newsgroups | gmane.comp.web.html-tidy.devel |
|---|---|
| Message-ID | <CAPuVx4NathBg8CtYmaV76V2WV7x4B0vDaWZX0RYT5tBW52npWw@mail.gmail.com> |
--===============7828811728190901538== Content-Type: multipart/alternative; boundary=089e0111d57c69c554051ac1f91e --089e0111d57c69c554051ac1f91e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @flok99 <https://github.com/flok99> Not sure what you mean by 'let me know where to rebase to'? Now and again a fork should be rebased back to the master it came from, namely htacg/tidy-html5... just to keep it in sync... that's all... > When will, by the way, http://tidy.sourceforge.net/ point to the new > locations? (website, github) We have had some discussions with the sourceforge maintainers, arnaud02, creitzel, and hoehrmann, but have only ever heard from the latter... We have offered to do just as you say... we have presented a proposal to re-join all tidy efforts together... present one tidy... The last communication was probably about a month ago now, so I do not know where things will go... or when... Will cross post this on the tidy-dev list... Regards, Geoff. On Mon, Jul 13, 2015 at 8:27 AM, folkert <[email protected]> wrote: > Ok let me now where to rebase to. > > On Mon, Jul 13, 2015 at 02:37:28AM +0200, Tidy Project wrote: > > Hi folkert, > > > > Thanks.. have seen the PR... > > > > Had to do a bit of final release branch creation, overdue... > > > > This PR could be the first 5.1.1 (development) master branch ;=3D)) > > > > You may need to rebase your fork... can help if needed,,, > > > > Will test over the coming days... as time permits... > > > > Hope this is the last here, since requires I login under another > account... > > but no problem... > > > > Regards, > > Geoff. > > > > PS: My email client is instructed to ignore receipt requests, sorry... > > > > > > On Sun, Jul 12, 2015 at 8:40 PM, folkert <[email protected]> wrote= : > > > > > Thanks for the reply. > > > I've merged my patch (which has been extended for an attribute-delete= r > > > as well) into my github-fork. If all went well you've received a > > > pull-request. > > > > > > Note that I DID test the node-delete (works for me, no valgrind error= s > > > either) but I did not yet test the attribute-delete (altough it > > > compiles cleanly). > > > > > > On Sun, Jul 12, 2015 at 08:30:48PM +0200, Tidy Project wrote: > > > > Hi folkert, > > > > > > > > The current development of tidy is here - > > > > > > > > https://github.com/htacg/tidy-html5 > > > > > > > > It looks like a simple API extension, at no cost ;=3D)) > > > > > > > > If you open an issue here - > > > > > > > > https://github.com/htacg/tidy-html5/issues > > > > > > > > it will certainly be considered... either as a patch, or PR... > > > > > > > > Thanks... > > > > > > > > Geoff. > > > > > > > > > > > > > > > > On Sun, Jul 12, 2015 at 2:36 PM, folkert <[email protected]> > wrote: > > > > > > > > > Hi, > > > > > > > > > > Here's a patch for (lib-)tidy which allows developers to remove a > node > > > > > from a dom. > > > > > I added this function so that I can use (lib-)tidy in a piece of > code > > > > > which removes dangerous html (dangerous for my use-case). For > example > > > > > scripting, iframes, etc. > > > > > Please consider including it. Thanks. > > > > > > > > > > > > > > > diff -uNrBbd tidy/include/tidy.h tidy-new/include/tidy.h > > > > > --- tidy/include/tidy.h 2008-04-22 11:00:42.000000000 +0000 > > > > > +++ tidy-new/include/tidy.h 2015-07-12 11:59:11.251382612 +00= 00 > > > > > @@ -801,6 +801,9 @@ > > > > > TIDY_EXPORT TidyNode TIDY_CALL tidyGetHead( TidyDoc tdoc ); > > > > > TIDY_EXPORT TidyNode TIDY_CALL tidyGetBody( TidyDoc tdoc ); > > > > > > > > > > +/* remove a node */ > > > > > +TIDY_EXPORT TidyNode TIDY_CALL tidyDiscardElement( TidyDoc > tdoc, > > > > > TidyNode tnod ); > > > > > + > > > > > /* parent / child */ > > > > > TIDY_EXPORT TidyNode TIDY_CALL tidyGetParent( TidyNode tnod )= ; > > > > > TIDY_EXPORT TidyNode TIDY_CALL tidyGetChild( TidyNode tnod ); > > > > > diff -uNrBbd tidy/src/tidylib.c tidy-new/src/tidylib.c > > > > > --- tidy/src/tidylib.c 2008-06-18 20:18:54.000000000 +0000 > > > > > +++ tidy-new/src/tidylib.c 2015-07-12 11:55:04.745221204 +00= 00 > > > > > @@ -1499,6 +1499,15 @@ > > > > > return tidyImplToNode( nimp->content ); > > > > > } > > > > > > > > > > +/* remove a node */ > > > > > +TidyNode TIDY_CALL tidyDiscardElement( TidyDoc tdoc, TidyNode > tnod > > > ) > > > > > +{ > > > > > + TidyDocImpl* doc =3D tidyDocToImpl( tdoc ); > > > > > + Node* nimp =3D tidyNodeToImpl( tnod ); > > > > > + Node* next =3D TY_(DiscardElement)( doc, nimp ); > > > > > + return tidyImplToNode( next ); > > > > > +} > > > > > + > > > > > /* siblings */ > > > > > TidyNode TIDY_CALL tidyGetNext( TidyNode tnod ) > > > > > { > > > > > > > > > > > > > > > Folkert van Heusden > > > > > > > > > > -- > > > > > MultiTail er et flexible tool for =C3=A5 kontrolere Logfiles og > commandoer. > > > > > Med filtrer, farger, sammenf=C3=B8ringer, forskeliger ansikter et= c. > > > > > http://www.vanheusden.com/multitail/ > > > > > > ---------------------------------------------------------------------- > > > > > Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------------------= ----- > > > > > Don't Limit Your Business. Reach for the Cloud. > > > > > GigeNET's Cloud Solutions provide you with the tools and support > that > > > > > you need to offload your IT needs and focus on growing your > business. > > > > > Configured For All Businesses. Start Your Cloud Today. > > > > > https://www.gigenetcloud.com/ > > > > > _______________________________________________ > > > > > Tidy-develop mailing list > > > > > [email protected] > > > > > https://lists.sourceforge.net/lists/listinfo/tidy-develop > > > > > > > > > > > > > > Folkert van Heusden > > > > > > -- > > > Wintips voor de staatsloterij? http://www.slimwinnen.nl/ > > > Meer weten over Bitcoins? http://www.vanheusden.com/bitcoins/ > > > Meer weten over TOR? http://www.vanheusden.com/tor/ > > > ---------------------------------------------------------------------= - > > > Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com > > > > > > Folkert van Heusden > > -- > MultiTail er et flexible tool for =C3=A5 kontrolere Logfiles og commandoe= r. > Med filtrer, farger, sammenf=C3=B8ringer, forskeliger ansikter etc. > http://www.vanheusden.com/multitail/ > ---------------------------------------------------------------------- > Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com > --089e0111d57c69c554051ac1f91e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><p style=3D"margin-bottom:16px;color:rgb(51,51,51);fo= nt-family:'Helvetica Neue',Helvetica,'Segoe UI',Arial,frees= ans,sans-serif;font-size:14px;line-height:22.3999996185303px;margin-top:0px= !important"><a href=3D"https://github.com/flok99" class=3D"" style=3D"color= :rgb(51,51,51);text-decoration:none;font-weight:bold;white-space:nowrap;bac= kground-color:transparent">@flok99</a>=C2=A0Not sure what you mean by '= let me know where to rebase to'?</p><p style=3D"margin-top:0px;margin-b= ottom:16px;color:rgb(51,51,51);font-family:'Helvetica Neue',Helveti= ca,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height:= 22.3999996185303px">Now and again a fork should be rebased back to the mast= er it came from, namely htacg/tidy-html5... just to keep it in sync... that= 's all...</p></div><span style=3D"color:rgb(51,51,51);font-family:'= Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;= font-size:14px;line-height:21px;white-space:pre-wrap">> When will, by th= e way, </span><a href=3D"http://tidy.sourceforge.net/" style=3D"color:rgb(6= 4,120,192);text-decoration:none;font-family:'Helvetica Neue',Helvet= ica,'Segoe UI',Arial,freesans,sans-serif;font-size:14px;line-height= :21px;white-space:pre-wrap">http://tidy.sourceforge.net/</a><span style=3D"= color:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Seg= oe UI',Arial,freesans,sans-serif;font-size:14px;line-height:21px;white-= space:pre-wrap"> point to the new > locations? (website, github)</span><br><div><span style=3D"color:rgb(5= 1,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe UI',= Arial,freesans,sans-serif;font-size:14px;line-height:21px;white-space:pre-w= rap"><br></span></div><div><p style=3D"margin-top:0px;margin-bottom:16px;co= lor:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Segoe= UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.3999996185= 303px">We have had some discussions with the sourceforge maintainers, arnau= d02, creitzel, and hoehrmann, but have only ever heard from the latter...</= p><p style=3D"margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-fa= mily:'Helvetica Neue',Helvetica,'Segoe UI',Arial,freesans,s= ans-serif;font-size:14px;line-height:22.3999996185303px">We have offered to= do just as you say... we have presented a proposal to=C2=A0<code style=3D"= font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font= -size:11.8999996185303px;padding:0.2em 0px;margin:0px;border-radius:3px;bac= kground-color:rgba(0,0,0,0.0392157)">re-join</code>=C2=A0all tidy efforts t= ogether... present=C2=A0<code style=3D"font-family:Consolas,'Liberation= Mono',Menlo,Courier,monospace;font-size:11.8999996185303px;padding:0.2= em 0px;margin:0px;border-radius:3px;background-color:rgba(0,0,0,0.0392157)"= >one</code>=C2=A0tidy...</p><p style=3D"margin-top:0px;margin-bottom:16px;c= olor:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Sego= e UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.399999618= 5303px">The last communication was probably about a month ago now, so I do = not know where things will go... or when...</p><p style=3D"margin-top:0px;c= olor:rgb(51,51,51);font-family:'Helvetica Neue',Helvetica,'Sego= e UI',Arial,freesans,sans-serif;font-size:14px;line-height:22.399999618= 5303px;margin-bottom:0px!important">Will cross post this on the tidy-dev li= st...</p><p style=3D"margin-top:0px;color:rgb(51,51,51);font-family:'He= lvetica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;fo= nt-size:14px;line-height:22.3999996185303px;margin-bottom:0px!important"><b= r></p><p style=3D"margin-top:0px;color:rgb(51,51,51);font-family:'Helve= tica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-= size:14px;line-height:22.3999996185303px;margin-bottom:0px!important">Regar= ds,</p><p style=3D"margin-top:0px;color:rgb(51,51,51);font-family:'Helv= etica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font= -size:14px;line-height:22.3999996185303px;margin-bottom:0px!important">Geof= f.</p><p style=3D"margin-top:0px;color:rgb(51,51,51);font-family:'Helve= tica Neue',Helvetica,'Segoe UI',Arial,freesans,sans-serif;font-= size:14px;line-height:22.3999996185303px;margin-bottom:0px!important"><br><= /p></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On= Mon, Jul 13, 2015 at 8:27 AM, folkert <span dir=3D"ltr"><<a href=3D"mai= lto:[email protected]" target=3D"_blank">[email protected]</a>>= ;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 = .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok let me now where to re= base to.<br> <div class=3D"HOEnZb"><div class=3D"h5"><br> On Mon, Jul 13, 2015 at 02:37:28AM +0200, Tidy Project wrote:<br> > Hi folkert,<br> ><br> > Thanks.. have seen the PR...<br> ><br> > Had to do a bit of final release branch creation, overdue...<br> ><br> > This PR could be the first 5.1.1 (development) master branch ;=3D))<br= > ><br> > You may need to rebase your fork... can help if needed,,,<br> ><br> > Will test over the coming days... as time permits...<br> ><br> > Hope this is the last here, since requires I login under another accou= nt...<br> > but no problem...<br> ><br> > Regards,<br> > Geoff.<br> ><br> > PS: My email client is instructed to ignore receipt requests, sorry...= <br> ><br> ><br> > On Sun, Jul 12, 2015 at 8:40 PM, folkert <<a href=3D"mailto:folkert= @vanheusden.com">[email protected]</a>> wrote:<br> ><br> > > Thanks for the reply.<br> > > I've merged my patch (which has been extended for an attribut= e-deleter<br> > > as well) into my github-fork. If all went well you've receive= d a<br> > > pull-request.<br> > ><br> > > Note that I DID test the node-delete (works for me, no valgrind e= rrors<br> > > either) but I did not yet test the attribute-delete (altough it<b= r> > > compiles cleanly).<br> > ><br> > > On Sun, Jul 12, 2015 at 08:30:48PM +0200, Tidy Project wrote:<br> > > > Hi folkert,<br> > > ><br> > > > The current development of tidy is here -<br> > > ><br> > > > <a href=3D"https://github.com/htacg/tidy-html5" rel=3D"noref= errer" target=3D"_blank">https://github.com/htacg/tidy-html5</a><br> > > ><br> > > > It looks like a simple API extension, at no cost ;=3D))<br> > > ><br> > > > If you open an issue here -<br> > > ><br> > > > <a href=3D"https://github.com/htacg/tidy-html5/issues" rel= =3D"noreferrer" target=3D"_blank">https://github.com/htacg/tidy-html5/issue= s</a><br> > > ><br> > > > it will certainly be considered... either as a patch, or PR.= ..<br> > > ><br> > > > Thanks...<br> > > ><br> > > > Geoff.<br> > > ><br> > > ><br> > > ><br> > > > On Sun, Jul 12, 2015 at 2:36 PM, folkert <<a href=3D"mail= to:[email protected]">[email protected]</a>> wrote:<br> > > ><br> > > > > Hi,<br> > > > ><br> > > > > Here's a patch for (lib-)tidy which allows develope= rs to remove a node<br> > > > > from a dom.<br> > > > > I added this function so that I can use (lib-)tidy in a= piece of code<br> > > > > which removes dangerous html (dangerous for my use-case= ). For example<br> > > > > scripting, iframes, etc.<br> > > > > Please consider including it. Thanks.<br> > > > ><br> > > > ><br> > > > > diff -uNrBbd tidy/include/tidy.h tidy-new/include/tidy.= h<br> > > > > --- tidy/include/tidy.h 2008-04-22 11:00:42.000000000 += 0000<br> > > > > +++ tidy-new/include/tidy.h=C2=A0 =C2=A0 =C2=A02015-07-= 12 11:59:11.251382612 +0000<br> > > > > @@ -801,6 +801,9 @@<br> > > > >=C2=A0 TIDY_EXPORT TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyG= etHead( TidyDoc tdoc );<br> > > > >=C2=A0 TIDY_EXPORT TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyG= etBody( TidyDoc tdoc );<br> > > > ><br> > > > > +/* remove a node */<br> > > > > +TIDY_EXPORT TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyDiscar= dElement( TidyDoc tdoc,<br> > > > > TidyNode tnod );<br> > > > > +<br> > > > >=C2=A0 /* parent / child */<br> > > > >=C2=A0 TIDY_EXPORT TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyG= etParent( TidyNode tnod );<br> > > > >=C2=A0 TIDY_EXPORT TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyG= etChild( TidyNode tnod );<br> > > > > diff -uNrBbd tidy/src/tidylib.c tidy-new/src/tidylib.c<= br> > > > > --- tidy/src/tidylib.c=C2=A0 2008-06-18 20:18:54.000000= 000 +0000<br> > > > > +++ tidy-new/src/tidylib.c=C2=A0 =C2=A0 =C2=A0 2015-07-= 12 11:55:04.745221204 +0000<br> > > > > @@ -1499,6 +1499,15 @@<br> > > > >=C2=A0 =C2=A0 return tidyImplToNode( nimp->content );= <br> > > > >=C2=A0 }<br> > > > ><br> > > > > +/* remove a node */<br> > > > > +TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyDiscardElement( Ti= dyDoc tdoc, TidyNode tnod<br> > > )<br> > > > > +{<br> > > > > +=C2=A0 TidyDocImpl* doc =3D tidyDocToImpl( tdoc );<br> > > > > +=C2=A0 Node* nimp =3D tidyNodeToImpl( tnod );<br> > > > > +=C2=A0 Node* next =3D TY_(DiscardElement)( doc, nimp )= ;<br> > > > > +=C2=A0 return tidyImplToNode( next );<br> > > > > +}<br> > > > > +<br> > > > >=C2=A0 /* siblings */<br> > > > >=C2=A0 TidyNode TIDY_CALL=C2=A0 =C2=A0 tidyGetNext( Tidy= Node tnod )<br> > > > >=C2=A0 {<br> > > > ><br> > > > ><br> > > > > Folkert van Heusden<br> > > > ><br> > > > > --<br> > > > > MultiTail er et flexible tool for =C3=A5 kontrolere Log= files og commandoer.<br> > > > > Med filtrer, farger, sammenf=C3=B8ringer, forskeliger a= nsikter etc.<br> > > > > <a href=3D"http://www.vanheusden.com/multitail/" rel=3D= "noreferrer" target=3D"_blank">http://www.vanheusden.com/multitail/</a><br> > > > > -------------------------------------------------------= ---------------<br> > > > > Phone: <a href=3D"tel:%2B31-6-41278122" value=3D"+31641= 278122">+31-6-41278122</a>, PGP-key: 1F28D8AE, <a href=3D"http://www.vanheu= sden.com" rel=3D"noreferrer" target=3D"_blank">www.vanheusden.com</a><br> > > > ><br> > > > ><br> > > > ><br> > > -----------------------------------------------------------------= -------------<br> > > > > Don't Limit Your Business. Reach for the Cloud.<br> > > > > GigeNET's Cloud Solutions provide you with the tool= s and support that<br> > > > > you need to offload your IT needs and focus on growing = your business.<br> > > > > Configured For All Businesses. Start Your Cloud Today.<= br> > > > > <a href=3D"https://www.gigenetcloud.com/" rel=3D"norefe= rrer" target=3D"_blank">https://www.gigenetcloud.com/</a><br> > > > > _______________________________________________<br> > > > > Tidy-develop mailing list<br> > > > > <a href=3D"mailto:[email protected]">T= [email protected]</a><br> > > > > <a href=3D"https://lists.sourceforge.net/lists/listinfo= /tidy-develop" rel=3D"noreferrer" target=3D"_blank">https://lists.sourcefor= ge.net/lists/listinfo/tidy-develop</a><br> > > > ><br> > ><br> > ><br> > > Folkert van Heusden<br> > ><br> > > --<br> > > Wintips voor de staatsloterij? <a href=3D"http://www.slimwinnen.n= l/" rel=3D"noreferrer" target=3D"_blank">http://www.slimwinnen.nl/</a><br> > >=C2=A0 =C2=A0 =C2=A0 Meer weten over Bitcoins? <a href=3D"http://w= ww.vanheusden.com/bitcoins/" rel=3D"noreferrer" target=3D"_blank">http://ww= w.vanheusden.com/bitcoins/</a><br> > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Meer weten over TOR? <a h= ref=3D"http://www.vanheusden.com/tor/" rel=3D"noreferrer" target=3D"_blank"= >http://www.vanheusden.com/tor/</a><br> > > -----------------------------------------------------------------= -----<br> > > Phone: <a href=3D"tel:%2B31-6-41278122" value=3D"+31641278122">+3= 1-6-41278122</a>, PGP-key: 1F28D8AE, <a href=3D"http://www.vanheusden.com" = rel=3D"noreferrer" target=3D"_blank">www.vanheusden.com</a><br> > ><br> <br> <br> Folkert van Heusden<br> <br> --<br> MultiTail er et flexible tool for =C3=A5 kontrolere Logfiles og commandoer.= <br> Med filtrer, farger, sammenf=C3=B8ringer, forskeliger ansikter etc.<br> <a href=3D"http://www.vanheusden.com/multitail/" rel=3D"noreferrer" target= =3D"_blank">http://www.vanheusden.com/multitail/</a><br> ----------------------------------------------------------------------<br> Phone: <a href=3D"tel:%2B31-6-41278122" value=3D"+31641278122">+31-6-412781= 22</a>, PGP-key: 1F28D8AE, <a href=3D"http://www.vanheusden.com" rel=3D"nor= eferrer" target=3D"_blank">www.vanheusden.com</a><br> </div></div></blockquote></div><br></div> --089e0111d57c69c554051ac1f91e-- --===============7828811728190901538== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ --===============7828811728190901538== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Tidy-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tidy-develop --===============7828811728190901538==--