function blogcontent()

in src/helpers/pages-blog.js [39:54]


function blogcontent (s) {
  // end of content
  const endofsection  = s.indexOf("<section class='tools'>")
  const endofarticle = s.indexOf("</article>")
  // possible starting point of article,
  const startofparagraph = s.indexOf('<div class="paragraph">')
  const startofpreamble = s.indexOf('<div id="preamble">')
  // take min if defined
  const startpoint = Math.min( startofparagraph>-1 ? startofparagraph : Infinity, startofpreamble >-1 ? startofpreamble: Infinity)
  const endpoint = Math.min( endofsection>-1 ? endofsection : Infinity, endofarticle >-1 ? endofarticle: Infinity)
  const split = s.substring( startpoint, endpoint)
  // hack for image
  const imagerewrite = split.replaceAll('"../../../_images','"../_images')
  //
  return imagerewrite
}