diff --git a/tasks/compile-docs.js b/tasks/compile-docs.js index 2c3d043645..078aa4e56b 100644 --- a/tasks/compile-docs.js +++ b/tasks/compile-docs.js @@ -87,7 +87,7 @@ _.extend(Compiler.prototype, { // Attempts to replace extension of content links to other documents compiledContents = compiledContents.replace(/.md/g, '.html'); - return compiledContents; + return compiledContents.stripBrTags(); }, getPageTitle: function(compiledContents) { @@ -109,8 +109,7 @@ _.extend(Compiler.prototype, { var description = compiledContents.match(/

([\s\S]*?)<\/p>/)[1]; return description - // force translation of breaks to a space - .replace(/
/g, ' ') + .stripBrTags() // remove remaining tags .replace(/\<[^\>]*\>/g, ''); // } @@ -326,3 +325,6 @@ module.exports = function(grunt) { .then(this.async()); }); }; + +String.prototype.stripBrTags = function() { return this.replace(/
/g, ' '); } +