From 1c5913b29f915c0410d753ec3bb9da4834debe29 Mon Sep 17 00:00:00 2001 From: Nick Playfair Date: Sun, 7 Mar 2021 17:35:11 +0000 Subject: [PATCH] Use js-beautify instead of pretty --- package-lock.json | 1 + package.json | 1 + src/bom2table.js | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5075600..5ca4be5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "license": "MIT", "dependencies": { "csvtojson": "^2.0.10", + "js-beautify": "^1.13.5", "pretty": "^2.0.0" }, "devDependencies": { diff --git a/package.json b/package.json index 77f9bf4..da69e3d 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "license": "MIT", "dependencies": { "csvtojson": "^2.0.10", + "js-beautify": "^1.13.5", "pretty": "^2.0.0" }, "devDependencies": { diff --git a/src/bom2table.js b/src/bom2table.js index 81f2362..a7f426b 100644 --- a/src/bom2table.js +++ b/src/bom2table.js @@ -1,6 +1,6 @@ /* eslint-disable array-callback-return */ // Modules -const pretty = require('pretty'); +const beautify = require('js-beautify').html; const csv = require('csvtojson'); // Configuration @@ -90,7 +90,7 @@ function generateTableBody(table, data) { function displayMarkup() { const tableCode = document.querySelector('table').outerHTML; const markup = document.getElementById('markup'); - markup.innerText = pretty(tableCode); + markup.innerText = beautify(tableCode); } function makeTable(csvString) {