title: HTMLDocument, HTMLEditorKit, and blank spaces
body: <p>When I run the following code:</p>
  
  <pre><code>import java.io.IOException;
  import java.io.Reader;
  import java.io.StringReader;
  
  import javax.swing.text.BadLocationException;
  import javax.swing.text.EditorKit;
  import javax.swing.text.Element;
  import javax.swing.text.html.HTMLDocument;
  import javax.swing.text.html.HTMLEditorKit;
      .
      .
      .
          String content = "x";
          String html = "&lt;html&gt;&lt;body&gt;&lt;dyn/&gt;" + content + "&lt;dyn/&gt;&lt;/body&gt;&lt;/html&gt;";
          final Reader reader = new StringReader(html);
          final EditorKit editorKit = new HTMLEditorKit();
  
          HTMLDocument hTMLDocument = new HTMLDocument();
          editorKit.read(reader, hTMLDocument, 0);
          Element defaultRootElement = hTMLDocument.getDefaultRootElement();
          Element branchElement = defaultRootElement.getElement(1).getElement(0);
          for (int i = 0; i &lt; branchElement.getElementCount(); i++) {
              Element element = branchElement.getElement(i);
              System.out.print(element);
          }
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>LeafElement(dyn) 1,2
  LeafElement(content) 2,3
  LeafElement(dyn) 3,4
  LeafElement(content) 4,5
  </code></pre>
  
  <p>However, if I change the value of <code>content</code> to <code>" "</code>:</p>
  
  <pre><code>    String content = " ";
  </code></pre>
  
  <p>I get this output:</p>
  
  <pre><code>LeafElement(dyn) 1,2
  LeafElement(dyn) 2,3
  LeafElement(content) 3,4
  </code></pre>
  
  <p>Why is a content <code>LeafElement</code> constructed for <code>"x"</code>, but not for <code>" "</code>?  I want a <code>LeafElement</code> to be constructed for <code>" "</code>.  Am I doing something wrong or is this a problem with <code>HTMLDocument</code> or <code>HTMLEditorKit</code>?</p>