From f25781acebbd98a0967127750ee960c5f66fb93a Mon Sep 17 00:00:00 2001 From: Rico Picone Date: Sat, 5 Mar 2022 21:17:29 -0800 Subject: [PATCH] =?UTF-8?q?fixes=20SaswatPadhi#29=20by=20adding=20a=20chec?= =?UTF-8?q?k=20that=20the=20backend=20exists=20before=E2=80=A6=20(#30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fixes SaswatPadhi#29 by adding a check that the backend exists before getting its name * needed npm install and make setup does not exist --- README.md | 2 +- package.json | 6 ++++-- pseudocode.js | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2b50643..28dcb1f 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ To compile the project on Ubuntu Linux, run the following commands in terminal: ```bash cd pseudocode.js/ -make setup +npm install make ``` diff --git a/package.json b/package.json index dc9ae62..0946925 100644 --- a/package.json +++ b/package.json @@ -21,10 +21,12 @@ "devDependencies": { "browserify": "^13.3.0", "clean-css-cli": "^4.0.0", - "eslint": "^7.0.0", + "eslint": "^7.32.0", "katex": "^0.8.0", "uglify-js": "^3.6.0", - "watchify": "^3.9.0" + "watchify": "^3.11.1", + "clean-css": "^5.2.4", + "uglifyjs": "^2.4.11" }, "license": "MIT" } diff --git a/pseudocode.js b/pseudocode.js index 5e467d0..d7bb00e 100644 --- a/pseudocode.js +++ b/pseudocode.js @@ -60,8 +60,10 @@ module.exports = { var newElem = renderer.toDOM(); elem.replaceWith(newElem); - if (renderer.backend.name === 'mathjax') { - mathjaxTypeset(newElem); + if (renderer.backend) { + if (renderer.backend.name === 'mathjax') { + mathjaxTypeset(newElem); + } } }, };