HTML Compactor

Discussion in 'HTML' started by Jeremy Ross, Mar 10, 2005.

  1. Jeremy Ross

    Jeremy Ross Guest

    Hello,

    I am looking for a program that will compact my HTML, so its all one one
    line, I have seen many of these programs around before but am now unable to
    find one that does this. If anyone knows of one that would be great.

    Thanks,

    Jeremy Ross
     
    Jeremy Ross, Mar 10, 2005
    #1
    1. Advertisements

  2. perl -p -e's/\n/\ /' my.html

    .... utterly pointless of course.

    (get Perl from http://www.activestate.com/ if you don't have it already)
     
    David Dorward, Mar 10, 2005
    #2
    1. Advertisements

  3. Why?
     
    Blinky the Shark, Mar 10, 2005
    #3
  4. Jeremy Ross

    Adrienne Guest

    Gazing into my crystal ball I observed Blinky the Shark
    Probably to "hide" it or make it difficult to view source.
     
    Adrienne, Mar 10, 2005
    #4
  5. Which is pointless since:
    (a) Good HTML is *very* simple and not worth copying
    and
    (b) HTML Tidy can make it readable again rather quickly
     
    David Dorward, Mar 10, 2005
    #5
  6. Jeremy Ross

    Toby Inkster Guest

    Google: mod_gzip.
     
    Toby Inkster, Mar 10, 2005
    #6
  7. FWIW, Notetab Lite (free from www.notetab.com) will do this. Use the replace
    function to replace "^p" with nothing and you're done.

    M
     
    Michael Laplante, Mar 10, 2005
    #7
  8. 1st Page 2000 will do it.
    <http://www.evrsoft.com/1stpage2.shtml>


    Richard Brooks.
     
    Richard Brooks, Mar 11, 2005
    #8
  9. Jeremy Ross

    Jeremy Ross Guest

    Hello,

    The real reason for wanting something like this, is because there is a
    program that uses the nl2br function in php, witch creates a <br> tag at
    every new line, now i am placing a table inside this function, witch is
    formated wiht each cell on a new line, so there are loads of <br> tages
    being placed in the code, and the table is moving down many lines because of
    this.

    I need that program to make it all on one line so there are no <br> tags
    being placed.

    Thanks,
    Jeremy
     
    Jeremy Ross, Mar 11, 2005
    #9
  10. Jeremy Ross

    marcus Guest

    In that case you don't need compaction, you need to edit the file and delete
    some of the BR tags.

    regards
    Marcus
     
    marcus, Mar 11, 2005
    #10
  11. Jeremy Ross

    Oli Filth Guest

    Or you should stop using the program that's replacing all newlines with
    <br>. Why are you using such a thing?
     
    Oli Filth, Mar 11, 2005
    #11
  12. Jeremy Ross

    dorayme Guest


    You saying you just want to remove some text? Do a global find <br> and
    replace with nothing at all... Using a text editor? Try command F or alt F
    or control F or look up the menus for this function... In mine, for example,
    one can change all instances in docs in a folder, I'm sure you would be able
    to.

    dorayme
     
    dorayme, Mar 11, 2005
    #12
  13. Jeremy Ross

    Sid Ismail Guest

    : > From: "Jeremy Ross" <>
    : > Newsgroups: alt.html
    : > Date: Fri, 11 Mar 2005 12:57:18 GMT
    : > Subject: Re: HTML Compactor
    : >
    : > Hello,
    : >
    : > The real reason for wanting something like this, is because there is a
    : > program that uses the nl2br function in php, witch creates a <br> tag at
    : > every new line, now i am placing a table inside this function, witch is
    : > formated wiht each cell on a new line, so there are loads of <br> tages
    : > being placed in the code, and the table is moving down many lines because of
    : > this.
    : >
    : > I need that program to make it all on one line so there are no <br> tags
    : > being placed\0\0\0: >
    : > Thanks,
    : > Jeremy
    :
    :
    : You saying you just want to remove some text? Do a
     
    Sid Ismail, Mar 12, 2005
    #13
  14. Jeremy Ross

    SpaceGirl Guest

    You have to be careful using programs that do this. Sadly, some browsers
    (ahem, IE) are sensitive to line breaks. Remove line breaks in nested
    tables (for example) can cause "gaps" to appear or disappear.
     
    SpaceGirl, Mar 14, 2005
    #14
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.