grunt/modules/html-parser.js in ustyle-1.15.3 vs grunt/modules/html-parser.js in ustyle-1.16.1
- old
+ new
@@ -1,24 +1,22 @@
-"use strict";
+const cheerio = require('cheerio')
-var cheerio = require('cheerio');
-
module.exports = {
- extractSubNav: function(content){
- var $ = cheerio.load(content),
- contents = [];
+ extractSubNav: function (content) {
+ var $ = cheerio.load(content)
+ var contents = []
- function buildHashOfContents(i, el) {
- contents.push({name: $(el).text(), link: $(el).attr('href')});
+ function buildHashOfContents (i, el) {
+ contents.push({name: $(el).text(), link: $(el).attr('href')})
}
- $('ul.table-of-contents a').map(buildHashOfContents);
- return contents;
+ $('ul.table-of-contents a').map(buildHashOfContents)
+ return contents
},
- removeSubNav: function(content){
- var $ = cheerio.load(content);
+ removeSubNav: function (content) {
+ var $ = cheerio.load(content)
- $('ul.table-of-contents').remove();
- return $.html();
+ $('ul.table-of-contents').remove()
+ return $.html()
}
}