Monday, May 19, 2008

ideas for pretty print HTML/XML

Now, over the weekend, I was thinking about pretty printing HTML/XML I figgered, armed with the desired right margin first find the "elements" that definitely need "breaking up" into multiple lines start in the "deepest" part of the tree, why not make it simple these are all the different ways can print element

1) <tag>tagtext</tag>tail

2) <tag>tagtext</tag>
   tail
  
3) <tag>
     tagtext
   </tag>
  
4) <tag>
   tagtext
   </tag>
  
5) text<markup>moretext</markup>texttext

6) <tag1><tag2>tagtext</tag2></tag1>

hmm...

No comments: