markmap-cli 0.15.8 → 0.15.9-alpha.11

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/dist/index.js +7 -7
  2. package/package.json +6 -5
package/dist/index.js CHANGED
@@ -9,11 +9,11 @@ import { buildCSSItem, buildJSItem, defer } from "markmap-common";
9
9
  import { Transformer, baseJsPaths } from "markmap-lib";
10
10
  export * from "markmap-lib";
11
11
  import { packageDirectory } from "pkg-dir";
12
- import { createReadStream, createWriteStream } from "fs";
13
- import { EventEmitter } from "events";
14
12
  import { serve } from "@hono/node-server";
15
- import { Hono } from "hono";
16
13
  import chokidar from "chokidar";
14
+ import { EventEmitter } from "events";
15
+ import { createReadStream, createWriteStream } from "fs";
16
+ import { Hono } from "hono";
17
17
  import { Readable } from "stream";
18
18
  import { finished } from "stream/promises";
19
19
  const TOOLBAR_VERSION = "0.15.8";
@@ -282,12 +282,12 @@ function startServer(paddingBottom) {
282
282
  dfs(root);
283
283
  return best;
284
284
  function dfs(node) {
285
- var _a, _b;
286
- const lines = (_a = node.payload) == null ? void 0 : _a.lines;
287
- if (lines && lines[0] <= lineWithoutFrontmatter && lineWithoutFrontmatter < lines[1]) {
285
+ var _a, _b, _c;
286
+ const [start, end] = ((_b = (_a = node.payload) == null ? void 0 : _a.lines) == null ? void 0 : _b.split(",").map((s) => +s)) || [];
287
+ if (start >= 0 && start <= lineWithoutFrontmatter && lineWithoutFrontmatter < end) {
288
288
  best = node;
289
289
  }
290
- (_b = node.children) == null ? void 0 : _b.forEach(dfs);
290
+ (_c = node.children) == null ? void 0 : _c.forEach(dfs);
291
291
  }
292
292
  }
293
293
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "markmap-cli",
3
- "version": "0.15.8",
3
+ "version": "0.15.9-alpha.11+d60da2f",
4
4
  "description": "Create markmaps from CLI",
5
5
  "author": "Gerald <gera2ld@live.com>",
6
6
  "license": "MIT",
@@ -28,6 +28,7 @@
28
28
  "clean": "del-cli dist",
29
29
  "build:types": "tsc",
30
30
  "build:js": "vite build",
31
+ "build": "run-s clean build:*",
31
32
  "postinstall": "node -e \"import('./dist/index.js').then(({ fetchAssets }) => fetchAssets()).catch(() => {})\""
32
33
  },
33
34
  "bugs": {
@@ -47,13 +48,13 @@
47
48
  "chokidar": "^3.5.3",
48
49
  "commander": "^11.1.0",
49
50
  "hono": "^3.11.8",
50
- "markmap-common": "0.15.6",
51
- "markmap-lib": "0.15.8",
52
- "markmap-toolbar": "0.15.8",
51
+ "markmap-common": "0.15.9-alpha.11+d60da2f",
52
+ "markmap-lib": "0.15.9-alpha.11+d60da2f",
53
+ "markmap-toolbar": "0.15.9-alpha.11+d60da2f",
53
54
  "open": "^10.0.0",
54
55
  "pkg-dir": "^8.0.0",
55
56
  "read-package-up": "^11.0.0",
56
57
  "update-notifier": "^7.0.0"
57
58
  },
58
- "gitHead": "d5a29ab4064a5496f879de04d730d7192461d3c5"
59
+ "gitHead": "d60da2fb13a85edec875ef002f1be414a0c00abe"
59
60
  }