dsh-chat-link-actions 0.2.17 → 0.2.18

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 +1 -1
  2. package/client.js +3 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  ## 认哪些链接
16
16
 
17
- 右键不是只认一种写法,常见渲染都走同一条解析:`href` / `src` 里的 `?path=`(图片、附件卡片)、`data-path` 之类的绝对路径属性、`title` 里的路径(宿主自绘的文件链接、文件夹链接)、以及直接写在正文里的绝对路径(光标落在路径上才算),包括代码块里的 `file.cjs#L12`、`#L12-L20` 这类带行号的写法(行号不进路径)。只显示「图标 + 文件名」、DOM 里没有路径的芯片(图片链接、Markdown 图片)也能认:路径从渲染它的组件属性里取。Windows 的 `C:\...`、`C:/...`、UNC 共享路径、含空格与中文的路径同样能认;正文里带空格的路径整条引用,芯片写作 `@"…"`。网页链接、`~` 和 `./` 开头的相对路径不当成本机文件。目录链接插入后是文件夹芯片(名字以 `/` 收尾),即使链接末尾没有斜杠。
17
+ 右键不是只认一种写法,常见渲染都走同一条解析:`href` / `src` 里的 `?path=`(图片、附件卡片)、`data-path` 之类的绝对路径属性、`title` 里的路径(宿主自绘的文件链接、文件夹链接)、以及直接写在正文里的绝对路径(光标落在路径上才算),包括代码块里的 `file.cjs#L12`、`#L12-L20` 这类带行号的写法(行号不进路径)。只显示「图标 + 文件名」、DOM 里没有路径的芯片(图片链接、Markdown 图片)也能认:路径从渲染它的组件属性里取。Windows 的 `C:\...`、`C:/...`、UNC 共享路径、含空格与中文的路径同样能认;正文里带空格的路径整条引用,芯片写作 `@"…"`。网页链接、`~` 和 `./` 开头的相对路径不当成本机文件;正文里单独一个词(`/help` 这类斜杠命令)不弹菜单,带扩展名或带层级的路径才算。目录链接插入后是文件夹芯片(名字以 `/` 收尾),即使链接末尾没有斜杠。
18
18
 
19
19
  ## 装
20
20
 
package/client.js CHANGED
@@ -291,6 +291,8 @@ window.__ModuleLoader__.load({
291
291
  if (word === null) break;
292
292
  remaining = remaining.slice(space[0].length + word[0].length);
293
293
  if (!continuesPath(word[0])) break;
294
+ /* 中文句子在路径后继续说话时,不要把后面的词吞进路径。 */
295
+ if (/^[\u3400-\u9fff]+$/u.test(word[0]) && !/\.[A-Za-z0-9]{1,8}$/u.test(word[0])) break;
294
296
  var joined = best + " " + word[0];
295
297
  if (PATH_TAIL.test(joined)) best = joined;
296
298
  else if (!PATH_TAIL.test(best)) {
@@ -994,6 +996,7 @@ window.__ModuleLoader__.load({
994
996
 
995
997
  /** Prose needs a real path shape: /help and skill chips must stay native. */
996
998
  function looksLikePath(value) {
999
+ if (/^[A-Za-z]:[\\/]/u.test(value)) return true;
997
1000
  var rest = value.replace(/^(?:[A-Za-z]:)?[\\/]+/u, "");
998
1001
  if (rest === "") return false;
999
1002
  if (/[\\/]/u.test(rest)) return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-chat-link-actions",
3
- "version": "0.2.17",
3
+ "version": "0.2.18",
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",