metalsmith-prism 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +8 -8
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -14,9 +14,9 @@ const isHTMLFile = (filePath) => {
14
14
 
15
15
  /**
16
16
  * Metalsmith plugin to highlight code syntax with PrismJS
17
- *
18
- * @param {Object} options
19
- * @returns
17
+ *
18
+ * @param {Object} options
19
+ * @returns
20
20
  */
21
21
 
22
22
  module.exports = (options) => {
@@ -38,8 +38,8 @@ module.exports = (options) => {
38
38
  /**
39
39
  * requireLanguage
40
40
  * Require optional language package
41
- *
42
- * @param {*} language
41
+ *
42
+ * @param {*} language
43
43
  */
44
44
  function requireLanguage(language) {
45
45
  if (!languages[language]) {
@@ -56,11 +56,11 @@ module.exports = (options) => {
56
56
  /**
57
57
  * Prism hook "after-tokenize" used to add html for line numbers
58
58
  * Neccessary as we don't have a browser
59
- *
59
+ *
60
60
  * Sources:
61
61
  * https://github.com/PrismJS/prism/blob/master/plugins/line-numbers/prism-line-numbers.js#L109
62
62
  * https://stackoverflow.com/questions/59508413/static-html-generation-with-prismjs-how-to-enable-line-numbers
63
- *
63
+ *
64
64
  */
65
65
  const NEW_LINE_EXP = /\n(?!$)/g;
66
66
  let lineNumbersWrapper;
@@ -84,7 +84,7 @@ module.exports = (options) => {
84
84
  }
85
85
 
86
86
  const contents = files[file].contents.toString();
87
- const $ = cheerio.load(contents, { decodeEntities: false }, false);
87
+ const $ = cheerio.load(contents, { decodeEntities: false }, true);
88
88
  let highlighted = false;
89
89
 
90
90
  $('code').each(function() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metalsmith-prism",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Syntax highlighting for Metalsmith HTML templates using Prism.js",
5
5
  "main": "lib/index.js",
6
6
  "engines": {