title: Python doctest: result with multiple lines
body: <p>I can't get a <code>doctest</code> to work with a result which contains multiple lines and may contain empty lines at the beginning. This is probably caused by indentation and parsing issues. I've figured out some solutions:</p>
  
  <ul>
  <li>Write the desired result to a file, and <code>doctest</code> the comparison between the result and the file contents.</li>
  <li>Compare a hash of the result to a known hash. The main disadvantage of this approach is that the reader of the <code>doctest</code> learns very little about the desired result.</li>
  <li>Find a way to make doctest work with multi line results.</li>
  <li>Use <code>unittest</code> instead of <code>doctest</code>.</li>
  </ul>
  
  <p>Any ideas?</p>
  
  <h2>Code:</h2>
  
  <pre><code>    &gt;&gt;&gt; data_lists=[ {"Average execution" : [1, 2, 3, 2, 3]},
      ...                              {"Top execution"     : [3, 4, 5, 7, 8, 11, 6]},
      ...                              {"Current execution" : [1, 2, 1, 2, 1, 5]}       ]
      &gt;&gt;&gt; c=Chart(data_lists,
      ...         ("Large&lt;br&gt;rooster", "Rsync rooster", "Pool&lt;br&gt;Chicken", "Disease"),
      ...         width=700, height=300)
      &gt;&gt;&gt; print c.html.strip()
      &lt;div id="placeholder3" style="width:700px;height:300px"&gt;&lt;/div&gt;
  
      &lt;script id="source" language="javascript" type="text/javascript"&gt;
      $(function () {
  
      var d0 = [[0, 1], [4, 2], [8, 3], [12, 2], [16, 3]];
      var d1 = [[1, 3], [5, 4], [9, 5], [13, 7], [17, 8], [21, 11], [25, 6]];
      var d2 = [[2, 1], [6, 2], [10, 1], [14, 2], [18, 1], [22, 5]];
  
          $.plot($("#placeholder3"), [
  
          {   label: "Average execution",  data: d0,   bars: { show: true }  },
          {   label: "Top execution",  data: d1,   bars: { show: true }  },
          {   label: "Current execution",  data: d2,   bars: { show: true }  }
  
          ],
          {
              xaxis: { ticks: [[1.5, "Large&lt;br&gt;rooster"], [5.5, "Rsync&lt;br&gt;rooster"], [9.5, "Pool&lt;br&gt;Chicken"], [13.5, "Disease"]] }
          }
          );
      });
      &lt;/script&gt;
  </code></pre>
  
  <h2>Error:</h2>
  
  <pre><code>**********************************************************************
  File "HTML.py", line 28, in __main__.Chart.__init__
  Failed example:
      print c.html.strip()
  Expected:
      &lt;div id="placeholder3" style="width:700px;height:300px"&gt;&lt;/div&gt;
  Got:
      &lt;div id="placeholder3" style="width:700px;height:300px"&gt;&lt;/div&gt;
      &lt;BLANKLINE&gt;
          &lt;script id="source" language="javascript" type="text/javascript"&gt;
          $(function () {
      &lt;BLANKLINE&gt;
          var d0 = [[0, 1], [4, 2], [8, 3], [12, 2], [16, 3]];
          var d1 = [[1, 3], [5, 4], [9, 5], [13, 7], [17, 8], [21, 11], [25, 6]];
          var d2 = [[2, 1], [6, 2], [10, 1], [14, 2], [18, 1], [22, 5]];
      &lt;BLANKLINE&gt;
              $.plot($("#placeholder3"), [
      &lt;BLANKLINE&gt;
              {   label: "Average execution",  data: d0,   bars: { show: true }  },
              {   label: "Top execution",  data: d1,   bars: { show: true }  },
              {   label: "Current execution",  data: d2,   bars: { show: true }  }
      &lt;BLANKLINE&gt;
              ],
              {
                  xaxis: { ticks: [[1.5, "Large&lt;br&gt;rooster"], [5.5, "Rsync rooster"], [9.5, "Pool&lt;br&gt;Chicken"], [13.5, "Disease"]] }
              }
              );
          });
          &lt;/script&gt;
  **********************************************************************
  1 items had failures:
     1 of   3 in __main__.Chart.
  
  __init__
  ***Test Failed*** 1 failures.
  </code></pre>