function generateAbstract()

in library/markdown-parser/models/article.ts [132:146]


function generateAbstract(tokensList: ExtendTokensList, minLength: number): string {
  let abstractContent = '';
  tokensList.forEach(token => {
    if (abstractContent.length < minLength) {
      if (token.type === 'heading') {
        return;
      } else if (token.type === 'text') {
        abstractContent += decode(token.text);
      } else if (token.tokens) {
        abstractContent += generateAbstract(token.tokens, minLength);
      }
    }
  });
  return abstractContent;
}