ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Iffy/Cleaner.cpp
(Generate patch)

Comparing Iffy/Cleaner.cpp (file contents):
Revision 293 by Douglas Thrift, 2004-11-18T16:37:13-08:00 vs.
Revision 294 by douglas, 2004-12-10T23:57:12-08:00

# Line 8 | Line 8
8  
9   void Cleaner::clean()
10   {
11 <        //
11 >        // XXX: do stuff
12 >
13 >        if (segments.First().type != TAG || segments.First().tag != "html")
14 >        {
15 >                Tag tag(OPEN, "html");
16 >
17 >                segments.InsertFirst(tag);
18 >        }
19 >
20 >        if (segments.Last().type == TEXT)
21 >        {
22 >                std::string segment(segments.Last().text);
23 >
24 >                if (segment.find_first_not_of("\r\n") == std::string::npos) segments.RemoveLast();
25 >        }
26 >
27 >        if (segments.Last().type != TAG || segments.Last().tag != "html")
28 >        {
29 >                Tag tag(CLOSE, "html");
30 >
31 >                segments.InsertLast(tag);
32 >        }
33   }
34  
35   ios::PrintWriter& operator<<(ios::PrintWriter& pout, const Cleaner& cleaner)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines