diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/page/html.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/page/html.js b/lib/page/html.js index 329b626..5a13dcf 100644 --- a/lib/page/html.js +++ b/lib/page/html.js @@ -185,7 +185,11 @@ HTMLPipeline.prototype.applyAnnotations = function() { // This can totally be improved HTMLPipeline.prototype.extractDescription = function() { var $p = this.$('p'); - var description = $p.text().trim().slice(0, 300); + + var description = $p.text().trim(); + if (description.length > 300) { + description = description.slice(0, 300).trim()+'...'; + } this.opts.onDescription(description); }; |