Skip to content
Permalink
Browse files

Added article source to title output, fixed empty description string …

…output, closes #4
  • Loading branch information...
omgimanerd committed Mar 9, 2019
1 parent ca43f22 commit e8b2ced21f594c9dd714246cf1d1f5c6c87f6948
Showing with 4 additions and 2 deletions.
  1. +4 −2 server/formatter.js
@@ -103,10 +103,12 @@ const formatArticles = (articles, timezone) => {
* account for the table border and padding.
*/
const title = formatTextWrap(
article.title, DEFAULT_DISPLAY_WIDTH - 4).bold.cyan
`${article.source.name} - ${article.title}`,
DEFAULT_DISPLAY_WIDTH - 4).bold.cyan
const date = formatDate(moment(article.publishedAt).tz(timezone)).cyan
const description = formatTextWrap(
article.description, DEFAULT_DISPLAY_WIDTH - 4)
article.description || 'No description available.',
DEFAULT_DISPLAY_WIDTH - 4)
const url = String(article.url).underline.green
table.push([`${title}\n${date}\n${description}\n${url}`])
})

0 comments on commit e8b2ced

Please sign in to comment.
You can’t perform that action at this time.