HTML cleanup task

  • Thread starter Victor \Zverok\ Shepelev
  • Start date
V

Victor \Zverok\ Shepelev

Hi all.

Sorry, if the question seems dumb.

My task is: I have some HTML fragment; no limitations on it correctness,
except of there can't be tag cutted:
This is possible: [</tr>.......] (fragment starts with closing tag)
This is not: [tr>...........]

I need to do tasks:
* Cut some tags with those contents, for ex., all tables
[before<table>inside</table>after] => [before after]
* cut some tags, leaving content:
[before<div>after] => [before after]
* other tags to make "consistent":
[before</p>after] => [before after]
[<p>before</p>after] => [<p>before</p>after]
.....

Can it be done with Hpricot? Or any other options?

Thanks.

V.
 
D

Dmitry Borodaenko

V

Victor \Zverok\ Shepelev

From: Dmitry Borodaenko [mailto:[email protected]]
Sent: Thursday, November 30, 2006 4:21 PM
My task is: I have some HTML fragment; no limitations on it correctness,
except of there can't be tag cutted: (...)
Can it be done with Hpricot? Or any other options?

Tried HTMLTidy[0]?

Not really tried, but had thought about.
The problem is I need something really "small, smart and simple" not "huge
and almighty" (as Tidy seems).

But thanks for advice.
Dmitry Borodaenko

V.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top