var createPostInfoArray = function()

in assets/themes/zeppelin/js/medium.controller.js [22:44]


  var createPostInfoArray = function () {
    for (var idx in postInfo) {
      var post = postInfo[idx]

      // 1. remove HTML tag from description value
      var regExString = /(<([^>]+)>)/ig
      post.description = post.description.replace(regExString, '')
      // 2. remove 'Continue reading on Apache Zeppelin Stories »'
      post.description = post.description.replace(/Continue reading on Apache Zeppelin Stories »/g, '')
      // 3. replace unicode char -> string
      post.description = unicodeToChar(post.description)
      // 4. truncate description string & attach '...'
      post.description = truncateString(post.description)

      // parse strigified date to 'MMMM Do, YYYY' format (e.g October 4th, 2016)
      post.created = new Date(post.created)
      post.created = moment(post.created).format("MMMM Do, YYYY")

      postInfoArray.push(post)
    }

    $scope.postInfoArray = postInfoArray
  }