@diplodoc/cli 5.36.2 → 5.36.4

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.
@@ -7,6 +7,7 @@ export declare function getPcIconTitle(iconPath: string): string;
7
7
  export declare const PC_REGEX: RegExp;
8
8
  export declare const INCLUDE_REGEX: RegExp;
9
9
  export declare function findPcImages(content: string): AssetInfo[];
10
+ export declare function findHtmlDownloadLinks(content: string): AssetInfo[];
10
11
  export declare function findFileBlocks(content: string): AssetInfo[];
11
12
  export declare function findLinksInfo(content: string): AssetInfo[];
12
13
  export declare function findDefs(content: string): AssetInfo[];
package/build/index.js CHANGED
@@ -348548,7 +348548,7 @@ var import_config81 = require("@diplodoc/cli/lib/config");
348548
348548
 
348549
348549
  // src/constants.ts
348550
348550
  var import_node_path2 = require("node:path");
348551
- var VERSION = "5.36.2" ? "5.36.2" : "0.0.0";
348551
+ var VERSION = "5.36.4" ? "5.36.4" : "0.0.0";
348552
348552
  var MAIN_TIMER_ID = "Build time";
348553
348553
  var ASSETS_FOLDER = (0, import_node_path2.resolve)(__dirname, "../assets");
348554
348554
  var BUNDLE_FOLDER = "_bundle";
@@ -396010,8 +396010,8 @@ var run2 = async (argv2) => {
396010
396010
  if (import_node_worker_threads4.isMainThread && require.main === module) {
396011
396011
  (async () => {
396012
396012
  import_utils396.console.time(MAIN_TIMER_ID);
396013
- if ("5.36.2") {
396014
- import_utils396.console.log(`Using v${"5.36.2"} version`);
396013
+ if ("5.36.4") {
396014
+ import_utils396.console.log(`Using v${"5.36.4"} version`);
396015
396015
  }
396016
396016
  const report = await run2(process.argv);
396017
396017
  import_utils396.console.timeEnd(MAIN_TIMER_ID);
package/build/index.mjs CHANGED
@@ -348534,7 +348534,7 @@ import { Command as Command8 } from "@diplodoc/cli/lib/config";
348534
348534
 
348535
348535
  // src/constants.ts
348536
348536
  import { join, resolve as resolve2 } from "node:path";
348537
- var VERSION = "5.36.2" ? "5.36.2" : "0.0.0";
348537
+ var VERSION = "5.36.4" ? "5.36.4" : "0.0.0";
348538
348538
  var MAIN_TIMER_ID = "Build time";
348539
348539
  var ASSETS_FOLDER = resolve2(__dirname, "../assets");
348540
348540
  var BUNDLE_FOLDER = "_bundle";
@@ -396029,8 +396029,8 @@ var run2 = async (argv2) => {
396029
396029
  if (isMainThread4 && __require.main === module) {
396030
396030
  (async () => {
396031
396031
  console7.time(MAIN_TIMER_ID);
396032
- if ("5.36.2") {
396033
- console7.log(`Using v${"5.36.2"} version`);
396032
+ if ("5.36.4") {
396033
+ console7.log(`Using v${"5.36.4"} version`);
396034
396034
  }
396035
396035
  const report = await run2(process.argv);
396036
396036
  console7.timeEnd(MAIN_TIMER_ID);
@@ -4,16 +4,16 @@
4
4
  "976-40cbc1d2518eb8ea.js"
5
5
  ],
6
6
  "js": [
7
- "vendor-03ddcd4b4ab9d816.js",
7
+ "vendor-19f237a87f1f5fe7.js",
8
8
  "search-136c6c533ebeaf71.js",
9
9
  "react-869ecca253e3f1ec.js"
10
10
  ],
11
11
  "css": [
12
- "vendor-bfa992e1b96e6cdb.css",
13
- "search-e7f311eb4e98eb21.css",
14
- "vendor-fd82cec023329d94.rtl.css",
15
- "app-770ab0d68ddf2326.rtl.css",
16
- "search-100c3de1419a5f4c.rtl.css"
12
+ "vendor-7b29a77aa5e59089.css",
13
+ "search-f6f27ffe8681b3f7.css",
14
+ "vendor-ced6438b50954935.rtl.css",
15
+ "app-4e3b0f26f7fa4506.rtl.css",
16
+ "search-b2d5432b7fa3d50d.rtl.css"
17
17
  ]
18
18
  },
19
19
  "app": {
@@ -22,15 +22,15 @@
22
22
  ],
23
23
  "js": [
24
24
  "app-a183d21ccd5083cc.js",
25
- "vendor-03ddcd4b4ab9d816.js",
25
+ "vendor-19f237a87f1f5fe7.js",
26
26
  "react-869ecca253e3f1ec.js"
27
27
  ],
28
28
  "css": [
29
- "vendor-bfa992e1b96e6cdb.css",
30
- "app-4549f2fee3364582.css",
31
- "vendor-fd82cec023329d94.rtl.css",
32
- "app-770ab0d68ddf2326.rtl.css",
33
- "search-100c3de1419a5f4c.rtl.css"
29
+ "vendor-7b29a77aa5e59089.css",
30
+ "app-492024a6eb040b4d.css",
31
+ "vendor-ced6438b50954935.rtl.css",
32
+ "app-4e3b0f26f7fa4506.rtl.css",
33
+ "search-b2d5432b7fa3d50d.rtl.css"
34
34
  ]
35
35
  }
36
36
  }
@@ -279,6 +279,31 @@ function findPcImages(content) {
279
279
  }
280
280
  return pcImages;
281
281
  }
282
+ function findHtmlDownloadLinks(content) {
283
+ const assets = [];
284
+ const tagRx = /<a\s[^>]*?\bdownload\b[^>]*>/gi;
285
+ const hrefRx = /\bhref="([^"]+)"/i;
286
+ let match;
287
+ while ((match = tagRx.exec(content)) !== null) {
288
+ const hrefMatch = hrefRx.exec(match[0]);
289
+ if (!hrefMatch) {
290
+ continue;
291
+ }
292
+ const parsed = (0, import_utils2.parseLocalUrl)(hrefMatch[1]);
293
+ if (!parsed) {
294
+ continue;
295
+ }
296
+ assets.push({
297
+ ...parsed,
298
+ type: "link",
299
+ subtype: null,
300
+ title: "",
301
+ autotitle: false,
302
+ location: [match.index, match.index + match[0].length]
303
+ });
304
+ }
305
+ return assets;
306
+ }
282
307
  function findFileBlocks(content) {
283
308
  const fileAssets = [];
284
309
  const rx = /{%\s*file\s.*?src="([^"]+)".*?%}/g;
@@ -674,7 +699,8 @@ function resolveAssets(content) {
674
699
  const links = filterRanges(exclude, findLinksInfo(content));
675
700
  const pcImages = filterRanges(exclude, findPcImages(content));
676
701
  const fileBlocks = filterRanges(exclude, findFileBlocks(content));
677
- for (const info of [...defs, ...links, ...pcImages, ...fileBlocks]) {
702
+ const htmlDownloadLinks = filterRanges(exclude, findHtmlDownloadLinks(content));
703
+ for (const info of [...defs, ...links, ...pcImages, ...fileBlocks, ...htmlDownloadLinks]) {
678
704
  try {
679
705
  if (info.path !== null && !info.path?.startsWith("*") && !info.path?.includes("%")) {
680
706
  info.path = (0, import_utils5.rebasePath)(this.path, decodeURIComponent(info.path));