7

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,890
  • 4
  • 31
  • 50
chakri
  • 599
  • 2
  • 10
  • 21

7 Answers7

6

Try this :

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

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

Mandeep Pasbola
  • 2,561
  • 2
  • 25
  • 49
4

Have yuou heard about this?

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

Or This

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

Raab
  • 33,432
  • 4
  • 48
  • 63
2

Check below good site

minifier

Tushar Gupta - curioustushar
  • 56,454
  • 22
  • 99
  • 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,102
  • 2
  • 24
  • 33
0

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

Yuvaraj P
  • 2,067
  • 3
  • 13
  • 12
0

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