angular-docs-cn/public/api-builder/angular.io-package/rendering/trimBlankLines.js

12 lines
257 B
JavaScript
Raw Normal View History

module.exports = function(encodeCodeBlock) {
return {
name: 'trimBlankLines',
process: function(str) {
var lines = str.split(/\r?\n/);
while(lines[0] === '') {
lines.shift();
}
return lines.join('\n');
}
};
};