diff --git a/CHANGELOG.md b/CHANGELOG.md
index f358865..454e22f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,18 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [0.22.2] - 2023-10-14
+
+### Fixed
+
+- Escaped backslashes (2 consecutive backslashes) were not appearing correctly in HTML output. e.g a snippet with a `body` of "\\${num};" appears as "\${num}".
+
+### Changed
+
+- Modify *webpack.config.js* to work with Node v18.x. It was throwing a ['ERR_OSSL_EVP_UNSUPPORTED' error](https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported) whose cause is: "itโs likely that your application or a module youโre using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0".
+- Updated tests in *formatter.test.js*.
+- Updated secret for GitHub Action to publish automatically.
+
## [0.22.1] - 2022-06-29
### Fixed
diff --git a/README.md b/README.md
index a62322d..c6eee52 100644
--- a/README.md
+++ b/README.md
@@ -69,7 +69,7 @@ If you have a suggestion or find a bug, please file an issue.
## Show gratitude
-If you are happy with the extension: please star the repo, and leave a review to help others find it. ๐
+If you are happy with the extension: please star the repo, and leave [a review ](https://marketplace.visualstudio.com/items?itemName=robole.snippets-ranger&ssr=false#review-details) in the marketplace to help others find it. ๐
You can [buy me a coffee or sponsor me](https://ko-fi.com/roboleary) if you would like to support me in maintaining this project and creating more open-source software. ๐
diff --git a/package.json b/package.json
index 5eb52c2..cce9ec9 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
},
"description": "View and edit all your snippets in one purty place. Yee-haw!",
"icon": "img/logo.png",
- "version": "0.22.1",
+ "version": "0.22.2",
"engines": {
"vscode": "^1.4.0",
"node": ">=12.0.0"
diff --git a/src/formatter.js b/src/formatter.js
index 70636a8..37f56bb 100644
--- a/src/formatter.js
+++ b/src/formatter.js
@@ -38,6 +38,7 @@ class Formatter {
.replace(/'/g, "'")
.replace(//g, ">")
+ .replace(/\\/g, "\\")
.replace(/\r?\n/g, "
")
.replace(/\t/g, " ");
@@ -45,13 +46,15 @@ class Formatter {
}
/**
- * Escapes all HTML content in the elements of an array and concatenates it into a string that can be consumed by a web page. Each value is appended with a HTML line break (BR tag).
+ * Escapes all HTML content in the elements of an array and concatenates it into a string
+ * that can be consumed by a web page. Each value is appended with a HTML line break (BR tag).
* @param {Array} array Array of values
*/
static escapeBody(array) {
let str = "";
array.forEach((element) => {
- str += `${Formatter.escapeHtml(element)}
`;
+ str += Formatter.escapeHtml(element);
+ str += "
";
});
return str;
}
diff --git a/src/view.js b/src/view.js
index a7742db..dc192a6 100644
--- a/src/view.js
+++ b/src/view.js
@@ -1,3 +1,4 @@
+/* eslint-disable class-methods-use-this */
// @ts-nocheck
// eslint-disable-next-line import/no-unresolved
const vscode = require("vscode");
@@ -220,9 +221,10 @@ class View {
${Formatter.escapeBody(snippet.body)}
";
+ table += Formatter.escapeBody(snippet.body);
+ table += "