9

My code is test.html:

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph.</p>

</body>
</html>

converting to

<!DOCTYPE html><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>

I am using manual converting , please tell me there is any online converter for converting multiline html code to single line html

Vinay
  • 6,891
  • 4
  • 32
  • 50
chakri
  • 629
  • 3
  • 11
  • 21

7 Answers7

11

Try this :

Minify HTML (or XHTML), and any CSS or JS included in your markup

http://www.willpeavy.com/minifier/

Mandeep Pasbola
  • 2,631
  • 2
  • 26
  • 50
5

Have yuou heard about this?

http://www.willpeavy.com/minifier/

Or This

http://www.textfixer.com/html/compress-html-compression.php

Raab
  • 34,778
  • 4
  • 50
  • 65
3

Check below good site

minifier

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
1

Here is a website that claims to do this..
http://www.odditysoftware.com/page-webtools16.htm

1

Try to use StringUtils.chomp

BufferedReader bufferedReader = new BufferedReader(new FileReader(FILE_NAME));
        String s = null;
        StringBuilder stringBuilder = new StringBuilder();
        while((s = bufferedReader.readLine()) != null)
        {
            stringBuilder.append(StringUtils.chomp(s));
        }

        System.out.println("stringBuilder : "+stringBuilder);
newuser
  • 8,338
  • 2
  • 25
  • 33
1

you can use any of the following to do this:

http://www.willpeavy.com/minifier/ or http://www.iwebtool.com/html_optimizer

shemy
  • 573
  • 1
  • 5
  • 15
0

use http://htmlcompressor.com/compressor/ Click 'Show options' and check 'Single line html output'

Yuvaraj P
  • 2,067
  • 3
  • 15
  • 12