nodebb-plugin-markdown 9.0.4 → 9.0.8

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.
package/index.js CHANGED
@@ -6,7 +6,6 @@ const path = require('path');
6
6
  const url = require('url');
7
7
 
8
8
  const probe = require('probe-image-size');
9
- const punycode = require('punycode');
10
9
 
11
10
  const nconf = require.main.require('nconf');
12
11
  const winston = require.main.require('winston');
@@ -402,11 +401,6 @@ const Markdown = {
402
401
  }
403
402
  }
404
403
 
405
- // Convert any homographs in link text to punycode
406
- if (tokens[idx + 1] && tokens[idx + 1].type === 'text') {
407
- tokens[idx + 1].content = punycode.toASCII(tokens[idx + 1].content);
408
- }
409
-
410
404
  return renderLink(tokens, idx, options, env, self);
411
405
  };
412
406
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-markdown",
3
- "version": "9.0.4",
3
+ "version": "9.0.8",
4
4
  "description": "A Markdown parser for NodeBB",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -34,19 +34,18 @@
34
34
  "markdown-it": "^12.0.6",
35
35
  "markdown-it-checkbox": "^1.1.0",
36
36
  "markdown-it-multimd-table": "^4.0.1",
37
- "probe-image-size": "^7.2.1",
38
- "punycode": "^2.1.1"
37
+ "probe-image-size": "^7.2.1"
39
38
  },
40
39
  "nbbpm": {
41
40
  "compatibility": "^1.17.0"
42
41
  },
43
42
  "devDependencies": {
44
- "@commitlint/cli": "16.1.0",
45
- "@commitlint/config-angular": "16.0.0",
46
- "eslint": "8.8.0",
43
+ "@commitlint/cli": "16.2.1",
44
+ "@commitlint/config-angular": "16.2.1",
45
+ "eslint": "8.9.0",
47
46
  "eslint-config-airbnb-base": "15.0.0",
48
47
  "eslint-plugin-import": "2.25.4",
49
48
  "husky": "7.0.4",
50
- "lint-staged": "12.3.2"
49
+ "lint-staged": "12.3.4"
51
50
  }
52
51
  }
package/plugin.json CHANGED
@@ -10,15 +10,13 @@
10
10
  "scripts": [
11
11
  "public/js/client.js"
12
12
  ],
13
- "acpScripts": [
14
- "public/js/admin.js"
15
- ],
16
13
  "staticDirs": {
17
14
  "themes": "../@highlightjs/cdn-assets/styles"
18
15
  },
19
16
  "modules": {
20
17
  "highlight.js": "../@highlightjs/cdn-assets/highlight.min.js",
21
- "highlightjs-line-numbers.js": "./public/js/highlightjs-line-numbers.js"
18
+ "highlightjs-line-numbers.js": "./public/js/highlightjs-line-numbers.js",
19
+ "../admin/plugins/markdown.js": "./public/js/admin.js"
22
20
  },
23
21
  "languages": "public/languages",
24
22
  "defaultLang": "en_GB",
@@ -8,13 +8,15 @@ module.exports = {
8
8
  timestamp: Date.UTC(2022, 0, 31),
9
9
  method: async () => {
10
10
  const { highlightTheme } = await meta.settings.get('markdown');
11
- await markdown.loadThemes();
11
+ if (highlightTheme) {
12
+ await markdown.loadThemes();
12
13
 
13
- let newTheme = highlightTheme.replace('.css', '.min.css');
14
- if (!markdown.themes.includes(newTheme)) {
15
- newTheme = 'default.min.css';
16
- }
14
+ let newTheme = highlightTheme.replace('.css', '.min.css');
15
+ if (!markdown.themes.includes(newTheme)) {
16
+ newTheme = 'default.min.css';
17
+ }
17
18
 
18
- await meta.settings.setOne('markdown', 'highlightTheme', newTheme);
19
+ await meta.settings.setOne('markdown', 'highlightTheme', newTheme);
20
+ }
19
21
  },
20
22
  };