diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 90bd4e2df..860257c52 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -15,10 +15,7 @@ const MAX_TITLE_LENGTH = 100; const getGoodBrewTitle = (text)=>{ const tokens = Markdown.marked.lexer(text); - let title = (tokens.find((token)=>token.type == 'heading' || token.type == 'paragraph') || { text: 'No Title' }).text; - if(title.length > MAX_TITLE_LENGTH) { - title = title.substr(0, MAX_TITLE_LENGTH); - } + const title = (tokens.find((token)=>token.type == 'heading' || token.type == 'paragraph') || { text: 'No Title' }).text.substr(0,MAX_TITLE_LENGTH); return title; };