dsh-chat-link-actions 0.2.13 → 0.2.15

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 (3) hide show
  1. package/README.md +2 -2
  2. package/client.js +1 -0
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -9,12 +9,12 @@
9
9
  | 右键文件链接 | 做什么 |
10
10
  | --- | --- |
11
11
  | **引用到对话** | 插成输入框里的引用芯片(`(</> 文件名)`),和拖文件、`@` 选文件的结果一样 |
12
- | **在文件管理器中查看** | 打开所在目录并选中这个文件(macOS 打开访达、Windows 打开资源管理器、Linux 打开所在目录) |
12
+ | **在文件管理器中查看** | 打开所在目录并选中这个文件;macOS 是访达、Windows 是资源管理器、Linux 是文件管理器,菜单文字三端一致 |
13
13
  | **复制路径** | 绝对路径进剪贴板,直接粘给别的窗口 |
14
14
 
15
15
  ## 认哪些链接
16
16
 
17
- 右键不是只认一种写法,常见渲染都走同一条解析:`href` / `src` 里的 `?path=`(图片、附件卡片)、`data-path` 之类的绝对路径属性、`title` 里的路径(宿主自绘的文件链接、文件夹链接)、以及直接写在正文里的绝对路径(光标落在路径上才算)。只显示「图标 + 文件名」、DOM 里没有路径的芯片(图片链接、Markdown 图片)也能认:路径从渲染它的组件属性里取。Windows 的 `C:\...`、UNC 共享路径、含空格与中文的路径同样能认;正文里带空格的路径整条引用,芯片写作 `@"…"`。目录链接插入后是文件夹芯片(名字以 `/` 收尾),即使链接末尾没有斜杠。
17
+ 右键不是只认一种写法,常见渲染都走同一条解析:`href` / `src` 里的 `?path=`(图片、附件卡片)、`data-path` 之类的绝对路径属性、`title` 里的路径(宿主自绘的文件链接、文件夹链接)、以及直接写在正文里的绝对路径(光标落在路径上才算),包括代码块里的 `file.cjs#L12`、`#L12-L20` 这类带行号的写法(行号不进路径)。只显示「图标 + 文件名」、DOM 里没有路径的芯片(图片链接、Markdown 图片)也能认:路径从渲染它的组件属性里取。Windows 的 `C:\...`、`C:/...`、UNC 共享路径、含空格与中文的路径同样能认;正文里带空格的路径整条引用,芯片写作 `@"…"`。网页链接、`~` 和 `./` 开头的相对路径不当成本机文件。目录链接插入后是文件夹芯片(名字以 `/` 收尾),即使链接末尾没有斜杠。
18
18
 
19
19
  ## 装
20
20
 
package/client.js CHANGED
@@ -188,6 +188,7 @@ window.__ModuleLoader__.load({
188
188
  if (/^\/[A-Za-z]:[\\/]/.test(candidate)) candidate = candidate.slice(1);
189
189
  }
190
190
  if (/^[A-Za-z]:(?![\\/])/u.test(candidate)) candidate = candidate.slice(0, 2) + "/" + candidate.slice(2);
191
+ if (!/^(?:[A-Za-z]:[\\/]?|[\\/]{1,2})$/u.test(candidate)) candidate = candidate.replace(/[\\/]+$/u, "");
191
192
  return looksAbsolute(candidate) ? candidate : null;
192
193
  }
193
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chat-link-actions",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "description": "Right-click actions on file links in the DSH transcript: quote the path into the composer, or reveal the file in the OS file manager. Menus are drawn in the app's own style, never the system one.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -48,5 +48,9 @@
48
48
  "repository": {
49
49
  "type": "git",
50
50
  "url": "git+https://github.com/regrevia/dsh-chat-link-actions.git"
51
+ },
52
+ "homepage": "https://github.com/regrevia/dsh-chat-link-actions#readme",
53
+ "bugs": {
54
+ "url": "https://github.com/regrevia/dsh-chat-link-actions/issues"
51
55
  }
52
56
  }