title: How to get unformatted html from Jsoup
body: <pre><code>String testCases[] = {
          "&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;div&gt;&lt;inline&gt;Normal Line Text&lt;/inline&gt;&lt;br/&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;",                  
  };
  for (String testString : testCases) {
      Document doc = Jsoup.parse(testString,"", Parser.xmlParser());
      Elements elements = doc.select("table");
      for (Element ele : elements) {
          System.out.println("===============================================");
          System.out.println(ele.html());                //Formatted
          System.out.println("-----------------------------------------------");
          System.out.println(ele.html().trim().replace("\n","").replace("\r",""));    //Notice the Difference
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>===============================================
  &lt;tbody&gt;
   &lt;tr&gt;
    &lt;td&gt;
     &lt;div&gt;
      &lt;inline&gt;
       Normal Line Text
      &lt;/inline&gt;
      &lt;br /&gt;
     &lt;/div&gt;&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/tbody&gt;
  -----------------------------------------------
  &lt;tbody&gt; &lt;tr&gt;  &lt;td&gt;   &lt;div&gt;    &lt;inline&gt;     Normal Line Text    &lt;/inline&gt;    &lt;br /&gt;   &lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;
  </code></pre>
  
  <p>Due to the formatting done by JSoup, the value of textNodes change to include newlines.</p>
  
  <p>Changing <code>&lt;inline&gt;</code> to <code>&lt;span&gt;</code> in the test case seems to work fine, but unfortunately, we have legacy data/html containing <code>&lt;inline&gt;</code> tags generated by redactor.</p>