title: Grabbing only the YAML text from a file in JS
body: <p>Suppose I have a file that has random text mixed with yaml text. The yaml text is always between a <code>---</code> and a <code>...</code>.</p>
  
  <p><strong>Goal:</strong> My goal is to take a string (taken from such a file):</p>
  
  <pre><code>---
  some: "yaml"
  some: "more yaml"
  ...
  
  Some random text that's not yaml.
  
  ---
  more: "yaml"
  ...
  </code></pre>
  
  <p>And output a string that contains <strong>only</strong> the yaml parts (including the <code>---</code> and <code>...</code> delimiters):</p>
  
  <pre><code>---
  some: "yaml"
  some: "more yaml"
  ...    
  ---
  more: "yaml"
  ...
  </code></pre>
  
  <p>How does one do this?</p>