Logo
Explore Help
Sign In
honeymoose/angular-cn
1
0
Fork 0
You've already forked angular-cn
Code Issues Pull Requests Packages Projects Releases Wiki Activity
angular-cn/tools/api-builder/angular.io-package/rendering/trimBlankLines.js

15 lines
365 B
JavaScript
Raw Normal View History

chore(angular.io-package): fix blank line trimming for Jade docs Jade does not like to have lines with only whitespace between processing marks and the start of the actual content. This fix provides a nunjucks filter that can strip off such offending whitespace when rendering into a Jade syntax file.
2015-09-18 11:35:46 +01:00
module.exports = function() {
Initial pass at moving api doc builder over to angular.io
2015-09-15 23:21:55 -07:00
return {
name: 'trimBlankLines',
process: function(str) {
var lines = str.split(/\r?\n/);
chore(angular.io-package): fix blank line trimming for Jade docs Jade does not like to have lines with only whitespace between processing marks and the start of the actual content. This fix provides a nunjucks filter that can strip off such offending whitespace when rendering into a Jade syntax file.
2015-09-18 11:35:46 +01:00
while(lines.length && (lines[0].trim() === '')) {
Initial pass at moving api doc builder over to angular.io
2015-09-15 23:21:55 -07:00
lines.shift();
}
api-builder: trim blank lines from the end of a text block too
2015-11-10 11:20:13 +00:00
while(lines.length && (lines[lines.length-1].trim() === '')) {
lines.pop();
}
Initial pass at moving api doc builder over to angular.io
2015-09-15 23:21:55 -07:00
return lines.join('\n');
}
};
};
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.1 Page: 552ms Template: 11ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API