Re: [PATCH] removing nodes from a dom
folkert <[email protected]> Mon, 13 Jul 2015 08:27:37 +0200
| Newsgroups | gmane.comp.web.html-tidy.devel |
|---|---|
| Organization | www.smartwinning.info |
| Message-ID | <[email protected]> |
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-deleter > > 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 errors > > 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]> wro= te: > > > > > > > Hi, > > > > > > > > Here's a patch for (lib-)tidy which allows developers to remove a n= ode > > > > from a dom. > > > > I added this function so that I can use (lib-)tidy in a piece of co= de > > > > which removes dangerous html (dangerous for my use-case). For examp= le > > > > 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 +0000 > > > > @@ -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 +0000 > > > > @@ -1499,6 +1499,15 @@ > > > > return tidyImplToNode( nimp->content ); > > > > } > > > > > > > > +/* remove a node */ > > > > +TidyNode TIDY_CALL tidyDiscardElement( TidyDoc tdoc, TidyNode t= nod > > ) > > > > +{ > > > > + 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 =E5 kontrolere Logfiles og comman= doer. > > > > Med filtrer, farger, sammenf=F8ringer, forskeliger ansikter etc. > > > > 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 th= at > > > > you need to offload your IT needs and focus on growing your busines= s. > > > > 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 =E5 kontrolere Logfiles og commandoer. Med filtrer, farger, sammenf=F8ringer, forskeliger ansikter etc. 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/