angular-cn/docs/angular.io-package/rendering/trimBlankLines.js

12 lines
257 B
JavaScript

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');
}
};
};