lib/cmsTxtToIntObj.js
function getSectionBody(sectionString) {
    /*first, use regular expressions to parse the section body into different
  objects */
    var sectionBody = {};
    var sectionBodyData = [];
    var objectFromBodyRegExp = /-*(\n){2,}(?!-{4,})[\S\s,]+?((?=((\n){3,}?))|\n\n$)/gi;
    //or go to the end of the string.
    var objectStrings = sectionString.match(objectFromBodyRegExp);
    //process each section object (from string to an actual object)
    for (var obj = 0; obj < objectStrings.length; obj++) {
        var sectionChild = processSectionChild(objectStrings[obj]);

        if (!isEmpty(sectionChild)) {
            if ('source' in sectionChild) {
                sectionBody.source = sectionChild.source;
            } else {
                sectionBodyData.push(sectionChild);
            }

        }
    }
    sectionBody.data = sectionBodyData;
    return sectionBody;

}
function getSectionBody(sectionString) {
    /*first, use regular expressions to parse the section body into different
  objects */
    var sectionBody = {};
    var sectionBodyData = [];
    var objectFromBodyRegExp = /-*(\n){2,}(?!-{4,})[\S\s,]+?((?=((\n){3,}?))|\n\n$)/gi;
    //or go to the end of the string.
    var objectStrings = sectionString.match(objectFromBodyRegExp);
    //process each section object (from string to an actual object)
    for (var obj = 0; obj < objectStrings.length; obj++) {
        var sectionChild = processSectionChild(objectStrings[obj]);

        if (!isEmpty(sectionChild)) {
            if ('source' in sectionChild) {
                sectionBody.source = sectionChild.source;
            } else {
                sectionBodyData.push(sectionChild);
            }

        }
    }
    sectionBody.data = sectionBodyData;
    return sectionBody;

}
function getSectionBody ( sectionString ) { /*first, use regular expressions to parse the section body into different
  objects */ var sectionBody = { } ; var sectionBodyData = [ ] ; var objectFromBodyRegExp = / -*(\n){2,}(?!-{4,})[\S\s,]+?((?=((\n){3,}?))|\n\n$) / gi ; //or go to the end of the string. var objectStrings = sectionString . match ( objectFromBodyRegExp ) ; //process each section object (from string to an actual object) for ( var obj = 0 ; obj < objectStrings . length ; obj ++ ) { var sectionChild = processSectionChild ( objectStrings [ obj ] ) ; if ( ! isEmpty ( sectionChild ) ) { if ( 'source' in sectionChild ) { sectionBody . source = sectionChild . source ; } else { sectionBodyData . push ( sectionChild ) ; } } } sectionBody . data = sectionBodyData ; return sectionBody ; }
parses the section body into an object
parses the section body into an object