wikity 1.3.6 → 1.3.7

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/dist/common.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegExpBuilder = void 0;
3
+ exports.RegExpBuilder = RegExpBuilder;
4
4
  function RegExpBuilder(regex, flag = 'mgi') {
5
5
  return RegExp(regex.replace(/ /g, '').replace(/\|\|.+?\|\|/g, ''), flag);
6
6
  }
7
- exports.RegExpBuilder = RegExpBuilder;
package/dist/compile.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.compile = exports.eleventyCompile = void 0;
6
+ exports.eleventyCompile = eleventyCompile;
7
+ exports.compile = compile;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const glob_1 = __importDefault(require("glob"));
@@ -13,7 +14,6 @@ const wiki_css_1 = __importDefault(require("./wiki.css"));
13
14
  function eleventyCompile(dir = '.', config = {}) {
14
15
  compile(dir, { eleventy: true, ...config });
15
16
  }
16
- exports.eleventyCompile = eleventyCompile;
17
17
  function compile(dir = '.', config = {}) {
18
18
  var _a, _b, _c;
19
19
  // set defaults
@@ -108,9 +108,7 @@ function compile(dir = '.', config = {}) {
108
108
  </html>
109
109
  `;
110
110
  // Write to file
111
- if (!fs_1.default.existsSync(path_1.default.dirname(outFilePath))) {
112
- fs_1.default.mkdirSync(path_1.default.dirname(outFilePath));
113
- }
111
+ fs_1.default.mkdirSync(path_1.default.dirname(outFilePath), { recursive: true });
114
112
  const formattedHtml = html.replace(/\n[\n\s]+/g, '\n');
115
113
  fs_1.default.writeFileSync(outFilePath, frontMatter + '\n' + formattedHtml, 'utf8');
116
114
  // Move images
@@ -118,9 +116,7 @@ function compile(dir = '.', config = {}) {
118
116
  if (err) {
119
117
  console.warn(err);
120
118
  }
121
- if (!fs_1.default.existsSync(outputImagesFolder)) {
122
- fs_1.default.mkdirSync(outputImagesFolder);
123
- }
119
+ fs_1.default.mkdirSync(outputImagesFolder, { recursive: true });
124
120
  for (const file of files) {
125
121
  fs_1.default.copyFileSync(file, path_1.default.join(outputImagesFolder, path_1.default.basename(file)));
126
122
  }
@@ -142,4 +138,3 @@ function compile(dir = '.', config = {}) {
142
138
  }
143
139
  });
144
140
  }
145
- exports.compile = compile;
package/dist/parse.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parse = exports.rawParse = void 0;
6
+ exports.rawParse = rawParse;
7
+ exports.parse = parse;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const dateformat_1 = __importDefault(require("dateformat"));
@@ -34,7 +35,6 @@ const escaper = (text, n = 0) => `%${text}#${n}`;
34
35
  function rawParse(data, config = {}) {
35
36
  return parse(data, config).data;
36
37
  }
37
- exports.rawParse = rawParse;
38
38
  function parse(data, config = {}) {
39
39
  var _a, _b, _c;
40
40
  const KEY = Math.random().toString().slice(2); // key used to allow certain disallowed HTML elements
@@ -414,4 +414,3 @@ function parse(data, config = {}) {
414
414
  const result = { data: outText, metadata: metadata };
415
415
  return result;
416
416
  }
417
- exports.parse = parse;
package/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # ISC License
2
2
 
3
- Copyright &copy; 2021&ndash;2024 Nixinova
3
+ Copyright &copy; 2021&ndash;2026 Nixinova
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
6
6
  purpose with or without fee is hereby granted, provided that the above
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikity",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Compile wikitext to HTML! Supporst use of wikitext as a templating language.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -39,7 +39,7 @@
39
39
  "license": "ISC",
40
40
  "dependencies": {
41
41
  "dateformat": "^4.6.3",
42
- "dedent": "^1.5.3",
42
+ "dedent": "^1.7.1",
43
43
  "escape-html": "^1.0.3",
44
44
  "glob": "^8.1.0"
45
45
  },