title: Get rendered html as text, including newlines
body: <p>I have a page with some html rendered into it.
  I want to get the rendered page as text, but somehow also include the  newlines. In addition, if relevant, I'm looking for an extended solution that will also support lists (using spaces and •), tables (using spaces, but with no borders) and similar cases.</p>
  
  <p>I'm looking for Javascript solution, either on client or server side.</p>
  
  <p>Please mind: not every element in the page equals to new line (e.g: some divs can be inline and some can create new lines).</p>
  
  <p>For exapmle, this snippet below will be the html, and the output will be the text itself as you can see below (after running).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#inline{
  display:flex;
  flex-direction:row;
  }
  
  #inline div{
  margin-right:5px;
  }
  
  #notInline{
  display:flex;
  flex-direction:column;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
  &lt;div id='inline'&gt;&lt;div&gt;some&lt;/div&gt;&lt;div&gt;divs&lt;/div&gt;&lt;div&gt;inline&lt;/div&gt;&lt;/div&gt;
  &lt;div id='notInline'&gt;&lt;div&gt;some&lt;/div&gt;&lt;div&gt;divs&lt;/div&gt;&lt;div&gt;on top of each other&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>