presentations/highlight-js/tools/keywordsformat.js

19 lines
346 B
JavaScript
Raw Permalink Normal View History

2018-12-07 08:48:05 -06:00
/** Example */
var all = 'keywords here';
var output = '', line = '';
all.forEach(function (item) {
if (12 + 1 + line.length + 1 + item.length + 4 > 120) {
output += "\n" + " '" + line + " ' +";
line = '';
return;
}
if (line) {
line = line + ' ' + item;
} else {
line = item;
}
});
console.log(output);