diff --git a/helpers/util.js b/helpers/util.js index 15d4ba3337..d982de91b5 100644 --- a/helpers/util.js +++ b/helpers/util.js @@ -5,7 +5,6 @@ const axios = require('axios') const zlib = require("zlib") const DOMParser = require('xmldom').DOMParser const urlParser = require('url') -const tablemark = require('tablemark') const supportedCategories = [ 'Auto','Business', 'Classic','Comedy','Documentary','Education','Entertainment', 'Family','Fashion','Food', 'General', 'Health', 'History', 'Hobby', 'Kids', 'Legislative','Lifestyle','Local', 'Movies', 'Music', 'News', 'Quiz', 'Religious','Sci-Fi', 'Shop', 'Sport', 'Travel', 'Weather', 'XXX' ] @@ -221,7 +220,32 @@ function skipPlaylist(filename) { } function generateTable(data, options) { - return tablemark(data, options) + let output = '' + + output += '' + for (let column of options.columns) { + output += `` + } + output += '' + + output += '' + for (let item of data) { + output += '' + let i = 0 + for (let prop in item) { + const column = options.columns[i] + let nowrap = column.nowrap + let align = column.align + output += `` + i++ + } + output += '' + } + output += '' + + output += '
${column.name}
${item[prop]}
' + + return output } module.exports = {